lkml.org 
[lkml]   [2006]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] shrink_list: Use of && instead || leads to unintended writing of pages
On Thu, 19 Jan 2006, Andrew Morton wrote:

> laptop_mode=1: don't write out dirty pages if we're only performing light
> scanning. But do write them out once page reclaim starts getting into
> difficulty.

Ahh. Now I see ..... Wrong field.

> I guess if zone reclaim wants to permanently disable writeback then it'll
> be needing a new scan_control flag for that. Which means that we need to

We have such a flag and its called may_swap (was introduced by Martin
Hicks). If we cannot swap then we should not write out pages.

Thus we need this fix instead:

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.16-rc1-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.16-rc1-mm1.orig/mm/vmscan.c 2006-01-19 15:50:19.000000000 -0800
+++ linux-2.6.16-rc1-mm1/mm/vmscan.c 2006-01-19 17:26:50.000000000 -0800
@@ -491,7 +491,7 @@ static int shrink_list(struct list_head
goto keep_locked;
if (!may_enter_fs)
goto keep_locked;
- if (laptop_mode && !sc->may_writepage)
+ if ((laptop_mode && !sc->may_writepage) || !sc->may_swap)
goto keep_locked;

/* Page is dirty, try to write it out here */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-01-20 02:32    [W:0.047 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site