linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmscan: zone_reclaim don't call disable_swap_token()
@ 2010-06-25  8:31 KOSAKI Motohiro
  2010-06-25 14:10 ` Rik van Riel
  2010-06-26 23:56 ` Minchan Kim
  0 siblings, 2 replies; 5+ messages in thread
From: KOSAKI Motohiro @ 2010-06-25  8:31 UTC (permalink / raw)
  To: Rik van Riel, Christoph Lameter, LKML, linux-mm, Andrew Morton
  Cc: kosaki.motohiro

Swap token don't works when zone reclaim is enabled since it was born.
Because __zone_reclaim() always call disable_swap_token()
unconditionally.

This kill swap token feature completely. As far as I know, nobody want
to that. Remove it.

Cc: Rik van Riel <riel@redhat.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 mm/vmscan.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9c7e57c..0c961f1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2590,7 +2590,6 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
 	};
 	unsigned long slab_reclaimable;
 
-	disable_swap_token();
 	cond_resched();
 	/*
 	 * We need to be able to allocate from the reserves for RECLAIM_SWAP
-- 
1.6.5.2



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: zone_reclaim don't call disable_swap_token()
  2010-06-25  8:31 [PATCH] vmscan: zone_reclaim don't call disable_swap_token() KOSAKI Motohiro
@ 2010-06-25 14:10 ` Rik van Riel
  2010-06-26 23:56 ` Minchan Kim
  1 sibling, 0 replies; 5+ messages in thread
From: Rik van Riel @ 2010-06-25 14:10 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: Christoph Lameter, LKML, linux-mm, Andrew Morton

On 06/25/2010 04:31 AM, KOSAKI Motohiro wrote:
> Swap token don't works when zone reclaim is enabled since it was born.
> Because __zone_reclaim() always call disable_swap_token()
> unconditionally.
>
> This kill swap token feature completely. As far as I know, nobody want
> to that. Remove it.
>
> Cc: Rik van Riel<riel@redhat.com>
> Cc: Christoph Lameter<cl@linux-foundation.org>
> Signed-off-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>

You are absolutely right.

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: zone_reclaim don't call disable_swap_token()
  2010-06-25  8:31 [PATCH] vmscan: zone_reclaim don't call disable_swap_token() KOSAKI Motohiro
  2010-06-25 14:10 ` Rik van Riel
@ 2010-06-26 23:56 ` Minchan Kim
  2010-06-28  1:37   ` KOSAKI Motohiro
  1 sibling, 1 reply; 5+ messages in thread
From: Minchan Kim @ 2010-06-26 23:56 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, LKML, linux-mm, Andrew Morton

On Fri, Jun 25, 2010 at 5:31 PM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
> Swap token don't works when zone reclaim is enabled since it was born.
> Because __zone_reclaim() always call disable_swap_token()
> unconditionally.
>
> This kill swap token feature completely. As far as I know, nobody want
> to that. Remove it.
>

In f7b7fd8f3ebbb, Rik added disable_swap_token.
At that time, sc.priority in zone_reclaim is zero so it does make sense.
But in a92f71263a, Christoph changed the priority to begin from
ZONE_RECLAIM_PRIORITY with remained disable_swap_token. It doesn't
make sense.

So doesn't we add disable_swap_token following as than removing?

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9c7e57c..d8050c7 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2590,7 +2590,6 @@ static int __zone_reclaim(struct zone *zone,
gfp_t gfp_mask, unsigned int order)
        };
        unsigned long slab_reclaimable;

-       disable_swap_token();
        cond_resched();
        /*
         * We need to be able to allocate from the reserves for RECLAIM_SWAP
@@ -2612,6 +2611,8 @@ static int __zone_reclaim(struct zone *zone,
gfp_t gfp_mask, unsigned int order)
                        note_zone_scanning_priority(zone, priority);
                        shrink_zone(priority, zone, &sc);
                        priority--;
+                       if (!priority)
+                               disable_swap_token();
                } while (priority >= 0 && sc.nr_reclaimed < nr_pages);
        }


-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: zone_reclaim don't call disable_swap_token()
  2010-06-26 23:56 ` Minchan Kim
@ 2010-06-28  1:37   ` KOSAKI Motohiro
  2010-06-28 10:46     ` Minchan Kim
  0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2010-06-28  1:37 UTC (permalink / raw)
  To: Minchan Kim
  Cc: kosaki.motohiro, Rik van Riel, Christoph Lameter, LKML, linux-mm,
	Andrew Morton

> On Fri, Jun 25, 2010 at 5:31 PM, KOSAKI Motohiro
> <kosaki.motohiro@jp.fujitsu.com> wrote:
> > Swap token don't works when zone reclaim is enabled since it was born.
> > Because __zone_reclaim() always call disable_swap_token()
> > unconditionally.
> >
> > This kill swap token feature completely. As far as I know, nobody want
> > to that. Remove it.
> >
> 
> In f7b7fd8f3ebbb, Rik added disable_swap_token.
> At that time, sc.priority in zone_reclaim is zero so it does make sense.
> But in a92f71263a, Christoph changed the priority to begin from
> ZONE_RECLAIM_PRIORITY with remained disable_swap_token. It doesn't
> make sense.
> 
> So doesn't we add disable_swap_token following as than removing?

f7b7fd8f3ebbb says disable_swap_token was introduced to prevent OOM.
but zone reclaim failure don't make OOM. instead, fallback to try_to_free_pages().

If the system have really heavy pressure, do_try_to_free_pages()
will call disable_swap_token().

So, What benefit is there?



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: zone_reclaim don't call disable_swap_token()
  2010-06-28  1:37   ` KOSAKI Motohiro
@ 2010-06-28 10:46     ` Minchan Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Minchan Kim @ 2010-06-28 10:46 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Rik van Riel, Christoph Lameter, LKML, linux-mm, Andrew Morton

On Mon, Jun 28, 2010 at 10:37 AM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> On Fri, Jun 25, 2010 at 5:31 PM, KOSAKI Motohiro
>> <kosaki.motohiro@jp.fujitsu.com> wrote:
>> > Swap token don't works when zone reclaim is enabled since it was born.
>> > Because __zone_reclaim() always call disable_swap_token()
>> > unconditionally.
>> >
>> > This kill swap token feature completely. As far as I know, nobody want
>> > to that. Remove it.
>> >
>>
>> In f7b7fd8f3ebbb, Rik added disable_swap_token.
>> At that time, sc.priority in zone_reclaim is zero so it does make sense.
>> But in a92f71263a, Christoph changed the priority to begin from
>> ZONE_RECLAIM_PRIORITY with remained disable_swap_token. It doesn't
>> make sense.
>>
>> So doesn't we add disable_swap_token following as than removing?
>
> f7b7fd8f3ebbb says disable_swap_token was introduced to prevent OOM.
> but zone reclaim failure don't make OOM. instead, fallback to try_to_free_pages().

Indeed. I missed that.
Thanks, Kosaki.

Reviewed-by: Minchan Kim <minchan.kim@gmail.com>


-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2010-06-28 10:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-25  8:31 [PATCH] vmscan: zone_reclaim don't call disable_swap_token() KOSAKI Motohiro
2010-06-25 14:10 ` Rik van Riel
2010-06-26 23:56 ` Minchan Kim
2010-06-28  1:37   ` KOSAKI Motohiro
2010-06-28 10:46     ` 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).