Re: [PATCH RFC] mm: Implement balance_dirty_pages() through waiting for flusher thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-06-17 at 20:04 +0200, Jan Kara wrote:
> +               if (bdi_stat(bdi, BDI_WRITTEN) >= bdi->wb_written_head)
> +                       bdi_wakeup_writers(bdi); 

For the paranoid amongst us you could make wb_written_head s64 and write
the above as:

  if (bdi_stat(bdi, BDI_WRITTEN) - bdi->wb_written_head > 0)

Which, if you assume both are monotonic and wb_written_head is always
within 2^63 of the actual bdi_stat() value, should give the same end
result and deal with wrap-around.

For when we manage to create a device that can write 2^64 pages in our
uptime :-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]