mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 17:20:32 -0800	[thread overview]
Message-ID: <20060119172032.04bad017.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.62.0601191648440.13602@schroedinger.engr.sgi.com>

Christoph Lameter <clameter@engr.sgi.com> wrote:
>
> On Thu, 19 Jan 2006, Andrew Morton wrote:
> 
> > The effects of this fix will be a) slightly improved memory allocator
> > latency, b) somehat improved disk writeout patterns and c) somewhat
> > increased risk of ooms.
> 
> If we do not operate in laptop mode and are not using zone_reclaim 
> (!may_writepage) which is the common case then there will be no effect at 
> all.

Ah, I misremembered how the code works.  Your patch will break laptop mode.

They way it works is:

laptop_mode=0: always write out dirty pages which come off the tail of the LRU.

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.

The idea is that in laptop mode we'll avoid spinning up the disk for
occasional random dirty pages which are interspersed amongst a majority of
clean, reclaimable pages.  But once reclaim is getting into trouble, we
need to spin that disk up anyway to clean out some memory.

Your patch means that in laptop moe we'll just never write out these dirty
pages ever - we'll overscan and go oom.


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
remember to initialise that flag in lots of different places, which is why
I dislike scan_control.  A (separate, preceding) patch which converts
scan_control initialisation to do memset+initialise-non-zero-members would
be appreciated.



  reply	other threads:[~2006-01-20  1:18 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 [this message]
2006-01-20  1:30       ` Christoph Lameter
2006-01-20  1:46       ` Christoph Lameter
2006-01-20  2:27         ` Andrew Morton
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=20060119172032.04bad017.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®