public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: akpm@osdl.org
Cc: greg@kroah.com, linux-kernel@vger.kernel.org,
	Andrea Arcangeli <andrea@suse.de>
Subject: Re: [patch 2/5] setup_per_zone_lowmem_reserve() oops fix
Date: Mon, 07 Mar 2005 19:10:05 +1100	[thread overview]
Message-ID: <422C0C5D.3060404@yahoo.com.au> (raw)
In-Reply-To: <200503042117.j24LHGrx017967@shell0.pdx.osdl.net>

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;
			}



  parent reply	other threads:[~2005-03-07  8:10 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 [this message]
2005-03-07  8:20   ` Andrew Morton
2005-03-07 13:02     ` Andrea Arcangeli
2005-03-07 13:00   ` 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=422C0C5D.3060404@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=greg@kroah.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