From: Andrew Morton <akpm@osdl.org>
To: Christoph Lameter <clameter@engr.sgi.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] shrink_list: Use of && instead || leads to unintended writing of pages
Date: Thu, 19 Jan 2006 18:27:18 -0800 [thread overview]
Message-ID: <20060119182718.575bd08a.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.62.0601191744390.13937@schroedinger.engr.sgi.com>
Christoph Lameter <clameter@engr.sgi.com> wrote:
>
> [PATCH] Implement sane function of sc->may_writepage
>
> Make sc->may_writepage control the writeout behavior of shrink_list.
>
> Remove the laptop_mode trick from shrink_list and instead set may_writepage in
> try_to_free_pages properly.
>
> 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:42:07.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 (!sc->may_writepage)
> goto keep_locked;
>
> /* Page is dirty, try to write it out here */
> @@ -1409,7 +1409,7 @@ int try_to_free_pages(struct zone **zone
> int i;
>
> sc.gfp_mask = gfp_mask;
> - sc.may_writepage = 0;
> + sc.may_writepage = !laptop_mode;
> sc.may_swap = 1;
>
> inc_page_state(allocstall);
> @@ -1512,7 +1512,7 @@ loop_again:
> total_scanned = 0;
> total_reclaimed = 0;
> sc.gfp_mask = GFP_KERNEL;
> - sc.may_writepage = 0;
> + sc.may_writepage = 1;
> sc.may_swap = 1;
> sc.nr_mapped = read_page_state(nr_mapped);
The balance_pgdat() change is wrong, surely? We want !laptop_mode.
next prev parent reply other threads:[~2006-01-20 2:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-20 0:05 Christoph Lameter
2006-01-20 0:43 ` Andrew Morton
2006-01-20 0:49 ` Christoph Lameter
2006-01-20 1:20 ` Andrew Morton
2006-01-20 1:30 ` Christoph Lameter
2006-01-20 1:46 ` Christoph Lameter
2006-01-20 2:27 ` Andrew Morton [this message]
2006-01-20 2:38 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060119182718.575bd08a.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=clameter@engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®