[lkml]   [2008]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH]swap-zero-page-bug
On Wed, 29 Oct 2008, Li Xiaodong wrote:

> According to Documentation/filesystems/proc.txt, kernel should swap one page
> as is 0, while it seems not like so in mm/swapfile.c:
> ...
> int our_page_cluster = page_cluster;
> ...
> if (!our_page_cluster) /* no readahead */
> return 0;
> ...
> It is better to remove that checkpoint.

No, page_cluster 0 allows swapin one page at a time, but disallows
swapin readahead (better named readaround) i.e. disallows reading
more than the one page actually requested.

Compare with how valid_swaphandles() is used from swapin_readahead():
there's actually one extra call to read_swap_cache_async() - because
we must ignore failure on the readaround but not on the page requested.

That "return 0" avoids the overhead of a pointlessly doubled
read_swap_cache_async() when there's only one page to be read.

Your patch might be needed if you'd found that swapin of one page
was not working at all - but you'd be making a stronger case if
you'd found that, I think!


 \ /
  Last update: 2008-11-01 11:37    [W:0.026 / U:2.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site