LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Problem with /proc/sys/vm/lowmem_reserve_ratio ???
@ 2008-02-15 14:50 Larry Woodman
  2008-02-18 14:33 ` Jeff Moyer
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Woodman @ 2008-02-15 14:50 UTC (permalink / raw)
  To: linux-kernel

balance_pgdat() calls zone_watermark_ok() three times, the first call
passes a zero(0) in as the 4th argument.  This 4th argument is the
classzone_idx which is used as the index into the 
zone->lowmem_reserve[] array.  Since setup_per_zone_lowmem_reserve()
always sets the zone->lowmem_reserve[0] = 0(because there is nothing
below the DMA zone), zone_watermark_ok() will not consider the
lowmem_reserve pages when zero is passed as the 4th arg.  Shouldnt this
4th argument be either "i" or "nr_zones - 1" ???

-------------------------------------------------------------------------
--- linux-2.6.24.noarch/mm/vmscan.c.orig        2008-02-13
11:14:55.000000000 -0500
+++ linux-2.6.24.noarch/mm/vmscan.c     2008-02-13 11:15:02.000000000
-0500
@@ -1375,7 +1375,7 @@ loop_again:
                                continue;

                        if (!zone_watermark_ok(zone, order, zone->pages_high,

-                                              0, 0)) {
+                                              i, 0)) {
                                end_zone = i;
                                break;
-------------------------------------------------------------------------
--- linux-2.6.24.noarch/mm/vmscan.c.orig        2008-02-13
11:14:55.000000000 -0500
+++ linux-2.6.24.noarch/mm/vmscan.c     2008-02-13 11:16:35.000000000
-0500
@@ -1375,7 +1375,7 @@ loop_again:
                                continue;

                        if (!zone_watermark_ok(zone, order, zone->pages_high,

-                                              0, 0)) {
+                                              nr_zones - 1, 0)) {
                                end_zone = i;
                                break;
                        }
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with /proc/sys/vm/lowmem_reserve_ratio ???
  2008-02-15 14:50 Problem with /proc/sys/vm/lowmem_reserve_ratio ??? Larry Woodman
@ 2008-02-18 14:33 ` Jeff Moyer
  2008-02-18 15:48   ` Rik van Riel
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Moyer @ 2008-02-18 14:33 UTC (permalink / raw)
  To: Larry Woodman; +Cc: linux-kernel, riel

Larry Woodman <lwoodman@redhat.com> writes:

> balance_pgdat() calls zone_watermark_ok() three times, the first call
> passes a zero(0) in as the 4th argument.  This 4th argument is the
> classzone_idx which is used as the index into the
> zone->lowmem_reserve[] array.  Since setup_per_zone_lowmem_reserve()
> always sets the zone->lowmem_reserve[0] = 0(because there is nothing
> below the DMA zone), zone_watermark_ok() will not consider the
> lowmem_reserve pages when zero is passed as the 4th arg.  Shouldnt this
> 4th argument be either "i" or "nr_zones - 1" ???

That certainly looks like the intent of this code.  I'd say patch 1,
passing i in as the 4th arg.  Rik, what do you think?

Cheers,

Jeff

>
> -------------------------------------------------------------------------
> --- linux-2.6.24.noarch/mm/vmscan.c.orig        2008-02-13
> 11:14:55.000000000 -0500
> +++ linux-2.6.24.noarch/mm/vmscan.c     2008-02-13 11:15:02.000000000
> -0500
> @@ -1375,7 +1375,7 @@ loop_again:
>                                continue;
>
>                        if (!zone_watermark_ok(zone, order, zone->pages_high,
>
> -                                              0, 0)) {
> +                                              i, 0)) {
>                                end_zone = i;
>                                break;
> -------------------------------------------------------------------------
> --- linux-2.6.24.noarch/mm/vmscan.c.orig        2008-02-13
> 11:14:55.000000000 -0500
> +++ linux-2.6.24.noarch/mm/vmscan.c     2008-02-13 11:16:35.000000000
> -0500
> @@ -1375,7 +1375,7 @@ loop_again:
>                                continue;
>
>                        if (!zone_watermark_ok(zone, order, zone->pages_high,
>
> -                                              0, 0)) {
> +                                              nr_zones - 1, 0)) {
>                                end_zone = i;
>                                break;
>                        }
> -------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with /proc/sys/vm/lowmem_reserve_ratio ???
  2008-02-18 14:33 ` Jeff Moyer
@ 2008-02-18 15:48   ` Rik van Riel
  0 siblings, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2008-02-18 15:48 UTC (permalink / raw)
  To: Jeff Moyer; +Cc: Larry Woodman, linux-kernel

On Mon, 18 Feb 2008 09:33:05 -0500
Jeff Moyer <jmoyer@redhat.com> wrote:

> Larry Woodman <lwoodman@redhat.com> writes:
> 
> > balance_pgdat() calls zone_watermark_ok() three times, the first call
> > passes a zero(0) in as the 4th argument.  This 4th argument is the
> > classzone_idx which is used as the index into the
> > zone->lowmem_reserve[] array.  Since setup_per_zone_lowmem_reserve()
> > always sets the zone->lowmem_reserve[0] = 0(because there is nothing
> > below the DMA zone), zone_watermark_ok() will not consider the
> > lowmem_reserve pages when zero is passed as the 4th arg.  Shouldnt this
> > 4th argument be either "i" or "nr_zones - 1" ???
> 
> That certainly looks like the intent of this code.  I'd say patch 1,
> passing i in as the 4th arg.  Rik, what do you think?

Yes, that is probably the best option.

-- 
All rights reversed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-18 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 14:50 Problem with /proc/sys/vm/lowmem_reserve_ratio ??? Larry Woodman
2008-02-18 14:33 ` Jeff Moyer
2008-02-18 15:48   ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).