LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] remove duplicating priority setting in try_to_free_p
@ 2008-01-26  7:29 minchan kim
  2008-01-28  5:33 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: minchan kim @ 2008-01-26  7:29 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel

shrink_zones in try_to_free_pages already set zone through
note_zone_scanning_priority.
So, setting prev_priority in try_to_free_pages is needless.

This patch is made by 2.6.24-rc8.

Signed-off-by: barrios <minchan.kim@gmail.com>
---
 mm/vmscan.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e5a9597..fc55c23 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1273,23 +1273,6 @@ unsigned long try_to_free_pages(struct z
    if (!sc.all_unreclaimable)
        ret = 1;
 out:
-   /*
-    * Now that we've scanned all the zones at this priority level, note
-    * that level within the zone so that the next thread which performs
-    * scanning of this zone will immediately start out at this priority
-    * level.  This affects only the decision whether or not to bring
-    * mapped pages onto the inactive list.
-    */
-   if (priority < 0)
-       priority = 0;
-   for (i = 0; zones[i] != NULL; i++) {
-       struct zone *zone = zones[i];
-
-       if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
-           continue;
-
-       zone->prev_priority = priority;
-   }
    return ret;
 }


-- 
Kinds regards,
barrios

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

* Re: [PATCH] remove duplicating priority setting in try_to_free_p
  2008-01-26  7:29 [PATCH] remove duplicating priority setting in try_to_free_p minchan kim
@ 2008-01-28  5:33 ` Andrew Morton
  2008-01-28  6:43   ` minchan kim
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-01-28  5:33 UTC (permalink / raw)
  To: minchan kim; +Cc: linux-mm, linux-kernel, Martin Bligh, Nick Piggin

On Sat, 26 Jan 2008 02:29:23 -0500 "minchan kim" <minchan.kim@gmail.com> wrote:

> shrink_zones in try_to_free_pages already set zone through
> note_zone_scanning_priority.
> So, setting prev_priority in try_to_free_pages is needless.
> 
> This patch is made by 2.6.24-rc8.
> 
> Signed-off-by: barrios <minchan.kim@gmail.com>
> ---
>  mm/vmscan.c |   17 -----------------
>  1 files changed, 0 insertions(+), 17 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index e5a9597..fc55c23 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1273,23 +1273,6 @@ unsigned long try_to_free_pages(struct z
>     if (!sc.all_unreclaimable)
>         ret = 1;
>  out:
> -   /*
> -    * Now that we've scanned all the zones at this priority level, note
> -    * that level within the zone so that the next thread which performs
> -    * scanning of this zone will immediately start out at this priority
> -    * level.  This affects only the decision whether or not to bring
> -    * mapped pages onto the inactive list.
> -    */
> -   if (priority < 0)
> -       priority = 0;
> -   for (i = 0; zones[i] != NULL; i++) {
> -       struct zone *zone = zones[i];
> -
> -       if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
> -           continue;
> -
> -       zone->prev_priority = priority;
> -   }
>     return ret;
>  }

(your mail client is replacing tabs with spaces)

I think this is actually a bugfix.  The code you're removing doesn't do the 

	if (priority < zone->prev_priority)

thing.

otoh with this change, the only thing which will cause prev_priority to
increase (ie: lower priority) is kswapd, which seems odd.

So:

a) this is a functional change and needs more thought and lots of runtime
   testing.  I'll duck it for now.

b) the prev_priority stuff is still screwed up.

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

* Re: [PATCH] remove duplicating priority setting in try_to_free_p
  2008-01-28  5:33 ` Andrew Morton
@ 2008-01-28  6:43   ` minchan kim
  2008-01-28  9:01     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: minchan kim @ 2008-01-28  6:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Martin Bligh, Nick Piggin

On Jan 28, 2008 2:33 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Sat, 26 Jan 2008 02:29:23 -0500 "minchan kim" <minchan.kim@gmail.com> wrote:
>
> > shrink_zones in try_to_free_pages already set zone through
> > note_zone_scanning_priority.
> > So, setting prev_priority in try_to_free_pages is needless.
> >
> > This patch is made by 2.6.24-rc8.
> >
> > Signed-off-by: barrios <minchan.kim@gmail.com>
> > ---
> >  mm/vmscan.c |   17 -----------------
> >  1 files changed, 0 insertions(+), 17 deletions(-)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index e5a9597..fc55c23 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -1273,23 +1273,6 @@ unsigned long try_to_free_pages(struct z
> >     if (!sc.all_unreclaimable)
> >         ret = 1;
> >  out:
> > -   /*
> > -    * Now that we've scanned all the zones at this priority level, note
> > -    * that level within the zone so that the next thread which performs
> > -    * scanning of this zone will immediately start out at this priority
> > -    * level.  This affects only the decision whether or not to bring
> > -    * mapped pages onto the inactive list.
> > -    */
> > -   if (priority < 0)
> > -       priority = 0;
> > -   for (i = 0; zones[i] != NULL; i++) {
> > -       struct zone *zone = zones[i];
> > -
> > -       if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
> > -           continue;
> > -
> > -       zone->prev_priority = priority;
> > -   }
> >     return ret;
> >  }
>
> (your mail client is replacing tabs with spaces)

Thank for your kindness.

> I think this is actually a bugfix.  The code you're removing doesn't do the
>
>         if (priority < zone->prev_priority)
>
> thing.
>

shrink_zones() in try_to_free_pages() already called
note_zone_scanning_priority().
So, it have done it.

> otoh with this change, the only thing which will cause prev_priority to
> increase (ie: lower priority) is kswapd, which seems odd.
>

So, There is not only kswapd but also direct page reclaim.

> So:
>
> a) this is a functional change and needs more thought and lots of runtime
>    testing.  I'll duck it for now.
>
> b) the prev_priority stuff is still screwed up.
>



-- 
Kinds regards,
barrios

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

* Re: [PATCH] remove duplicating priority setting in try_to_free_p
  2008-01-28  6:43   ` minchan kim
@ 2008-01-28  9:01     ` Andrew Morton
  2008-01-28 12:38       ` minchan kim
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-01-28  9:01 UTC (permalink / raw)
  To: minchan kim; +Cc: linux-mm, linux-kernel, Martin Bligh, Nick Piggin

On Mon, 28 Jan 2008 15:43:56 +0900 "minchan kim" <minchan.kim@gmail.com> wrote:

> > I think this is actually a bugfix.  The code you're removing doesn't do the
> >
> >         if (priority < zone->prev_priority)
> >
> > thing.
> >
> 
> shrink_zones() in try_to_free_pages() already called
> note_zone_scanning_priority().
> So, it have done it.

note_zone_scanning_priority() will only permit ->prev_priority to logically
increase, whereas the code which you've removed will also permit
->prev_priority to logically decrease.  So I don't see that they are
equivalent?


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

* Re: [PATCH] remove duplicating priority setting in try_to_free_p
  2008-01-28  9:01     ` Andrew Morton
@ 2008-01-28 12:38       ` minchan kim
  0 siblings, 0 replies; 5+ messages in thread
From: minchan kim @ 2008-01-28 12:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Martin Bligh, Nick Piggin

I agree with you.
If you will have a test result, Let me know it.

On Jan 28, 2008 6:01 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 28 Jan 2008 15:43:56 +0900 "minchan kim" <minchan.kim@gmail.com> wrote:
>
> > > I think this is actually a bugfix.  The code you're removing doesn't do the
> > >
> > >         if (priority < zone->prev_priority)
> > >
> > > thing.
> > >
> >
> > shrink_zones() in try_to_free_pages() already called
> > note_zone_scanning_priority().
> > So, it have done it.
>
> note_zone_scanning_priority() will only permit ->prev_priority to logically
> increase, whereas the code which you've removed will also permit
> ->prev_priority to logically decrease.  So I don't see that they are
> equivalent?
>
>



-- 
Kinds regards,
barrios

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

end of thread, other threads:[~2008-01-28 12:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-26  7:29 [PATCH] remove duplicating priority setting in try_to_free_p minchan kim
2008-01-28  5:33 ` Andrew Morton
2008-01-28  6:43   ` minchan kim
2008-01-28  9:01     ` Andrew Morton
2008-01-28 12:38       ` minchan kim

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).