From: Andrea Arcangeli <andrea@novell.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Rik van Riel <riel@redhat.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: lowmem_reserve (replaces protection)
Date: Wed, 27 Oct 2004 04:29:20 +0200 [thread overview]
Message-ID: <20041027022920.GS14325@dualathlon.random> (raw)
In-Reply-To: <417F025F.5080001@yahoo.com.au>
On Wed, Oct 27, 2004 at 12:05:19PM +1000, Nick Piggin wrote:
> Andrea Arcangeli wrote:
>
> >the per-classzone kswapd treshold was very well taken care of in 2.4,
> >thanks the watermarks embedding the low/min/high and the classzone being
> >passed up to the kswapd wakeup function.
> >
>
> Kswapd actually should take care of this properly: see the
> initial loop before the real scanning loop.
I don't see how it can take care of it, if it doesn't even get a wakeup?
kswapd just sleeps.
kswapd is just an optimization, we try provide async allocation if the
kswapd watermarks can it keep up between low and high (and we hang
synchronosly while hitting the wall at min), so it's not fatal that
kswapd sleeps, but it can be fixed easily with the patch I just posted
some minute ago.
> I thought this was a bit subtle, but it seems to work fine,
> and Andrew likes it.
>
> I have a patch to explicitly have kswapd use the lower zone
> protection watermarks but I haven't really demonstrated it is
> better than what is currently there (other than being simpler).
how can it ever wakeup if nobody ever calls
wake_up_interruptible(&zone->zone_pgdat->kswapd_wait)?
Now the patch I posted fixes the wakeup side, but I'm not sure that the
"stop" is properly done yet. Peraphs that's what you mean, that the
kswapd-stop decision already works despite not being aware of the
low memory ram reservation?
Following the code I see nr_pages is 0 in balance_pgdat when invoked
from kswapd. nr_pages then goes here:
if (nr_pages == 0) {
/*
* Scan in the highmem->dma direction for the
* highest
* zone which needs scanning
*/
for (i = pgdat->nr_zones - 1; i >= 0; i--) {
struct zone *zone = pgdat->node_zones + i;
if (zone->all_unreclaimable &&
priority != DEF_PRIORITY)
continue;
if (zone->free_pages <= zone->pages_high) {
end_zone = i;
goto scan;
}
}
goto out;
shouldn't we take the full watermarks into account in the above too?
I think so, otherwise we wakeup but it goes back to sleep, i.e.
overscheduling but nothing done still, so I'm going to fixup the stop as
well.
next prev parent reply other threads:[~2004-10-27 2:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-25 17:01 lowmem_reserve (replaces protection) Andrea Arcangeli
2004-10-26 1:48 ` Rik van Riel
2004-10-26 1:58 ` Andrea Arcangeli
2004-10-26 3:48 ` Nick Piggin
2004-10-26 4:04 ` Andrea Arcangeli
2004-10-26 4:17 ` Nick Piggin
2004-10-27 0:25 ` Andrea Arcangeli
2004-10-27 0:42 ` Andrew Morton
2004-10-27 0:48 ` Andrea Arcangeli
2004-10-27 2:06 ` Nick Piggin
2004-10-28 0:26 ` Andrea Arcangeli
2004-10-27 0:31 ` Rik van Riel
2004-10-27 0:54 ` Andrea Arcangeli
2004-10-27 0:56 ` Andrea Arcangeli
2004-10-27 1:35 ` Andrea Arcangeli
2004-10-27 2:08 ` Andrew Morton
2004-10-27 2:31 ` Andrea Arcangeli
2004-10-27 2:56 ` Nick Piggin
2004-10-27 1:00 ` Rik van Riel
2004-10-27 1:10 ` Andrea Arcangeli
2004-10-27 2:05 ` Nick Piggin
2004-10-27 2:29 ` Andrea Arcangeli [this message]
2004-10-27 3:01 ` Nick Piggin
2004-10-27 3:23 ` Andrea Arcangeli
2004-10-27 3:34 ` Nick Piggin
2004-10-27 3:43 ` Andrew Morton
2004-10-27 4:44 ` Andrea Arcangeli
2004-10-27 4:51 ` Rik van Riel
2004-10-27 5:05 ` Andrea Arcangeli
2004-10-27 5:50 ` Nick Piggin
2004-10-27 5:33 ` Andrew Morton
2004-10-27 6:11 ` Andrea Arcangeli
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=20041027022920.GS14325@dualathlon.random \
--to=andrea@novell.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=riel@redhat.com \
/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