From: Andrea Arcangeli <andrea@suse.de>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: akpm@osdl.org, greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/5] setup_per_zone_lowmem_reserve() oops fix
Date: Mon, 7 Mar 2005 14:00:44 +0100 [thread overview]
Message-ID: <20050307130043.GP8880@opteron.random> (raw)
In-Reply-To: <422C0C5D.3060404@yahoo.com.au>
On Mon, Mar 07, 2005 at 07:10:05PM +1100, Nick Piggin wrote:
> akpm@osdl.org wrote:
> >If you do 'echo 0 0 > /proc/sys/vm/lowmem_reserve_ratio' the kernel gets a
> >divide-by-zero.
> >
> >Prevent that, and fiddle with some whitespace too.
> >
> >Signed-off-by: Andrew Morton <akpm@osdl.org>
>
> Can we instead have a patch that makes the value zero turn off the
> lowmem reserve entirely if it is set to zero?
>
> Just now I was just testing, and found no easy way to do this other
> than to make the value large enough that the reserve is insignificant.
>
> So the loop would be something like:
>
> for (idx = j-1; idx >= 0; idx--) {
> struct zone *lower_zone;
> lower_zone = pgdat->node_zones + idx;
>
> lower_zone->lowmem_reserve[j] = 0;
> if (sysctl_lowmem_reserve_ratio[idx] > 0)
> lower_zone->lowmem_reserve[j] =
> present_pages /
> sysctl_lowmem_reserve_ratio[idx];
>
> present_pages += lower_zone->present_pages;
> }
Looks good to me. I noticed the divide by zero myself once, and I
also considered changing it so that zero disables it. Could you send a
full patch to Andrew? Thanks.
prev parent reply other threads:[~2005-03-07 13:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-04 21:16 [patch 2/5] setup_per_zone_lowmem_reserve() oops fix akpm
2005-03-06 6:23 ` Greg KH
2005-03-07 8:10 ` Nick Piggin
2005-03-07 8:20 ` Andrew Morton
2005-03-07 13:02 ` Andrea Arcangeli
2005-03-07 13:00 ` Andrea Arcangeli [this message]
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=20050307130043.GP8880@opteron.random \
--to=andrea@suse.de \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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