lkml.org 
[lkml]   [2008]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH]swap-zero-page-bug
Date
According to Documentation/filesystems/proc.txt, kernel should swap one page
as vm.page-cluster 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.

Signed-off-by: Li Xiaodong<lixd@cn.fujitsu.com>
--- swapfile.c.orig 2008-10-29 21:29:36.000000000 +0800
+++ swapfile.c 2008-10-29 21:59:49.000000000 +0800
@@ -1810,9 +1810,6 @@
pgoff_t base, end;
int nr_pages = 0;

- if (!our_page_cluster) /* no readahead */
- return 0;
-
si = &swap_info[swp_type(entry)];
target = swp_offset(entry);
base = (target >> our_page_cluster) << our_page_cluster; @@ -1847,5
+1844,5 @@
* if only 1, say 0, since there's then no readahead to be done.
*/
*offset = ++toff;
- return nr_pages? ++nr_pages: 0;
+ return nr_pages ? ++nr_pages : nr_pages;
}
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2008-10-29 07:41    [W:0.060 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site