linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap
@ 2009-04-18  6:26 KOSAKI Motohiro
  2009-04-18 18:43 ` Johannes Weiner
  0 siblings, 1 reply; 6+ messages in thread
From: KOSAKI Motohiro @ 2009-04-18  6:26 UTC (permalink / raw)
  To: Daisuke Nishimura, LKML, linux-mm, Andrew Morton, Johannes Weiner,
	Balbir Singh, KAMEZAWA Hiroyuki
  Cc: kosaki.motohiro

Subject: vmscan,memcg: reintroduce sc->may_swap

vmscan-rename-scmay_swap-to-may_unmap.patch removed may_swap flag,
but memcg had used it as a flag for "we need to use swap?", as the
name indicate.

And in current implementation, memcg cannot reclaim mapped file caches
when mem+swap hits the limit.

re-introduce may_swap flag and handle it at get_scan_ratio().
This patch doesn't influence any scan_control users other than memcg.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
--
 mm/vmscan.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c	2009-04-16 21:25:41.000000000 +0900
+++ b/mm/vmscan.c	2009-04-16 21:56:54.000000000 +0900
@@ -64,6 +64,9 @@ struct scan_control {
 	/* Can mapped pages be reclaimed? */
 	int may_unmap;
 
+	/* Can pages be swapped as part of reclaim? */
+	int may_swap;
+
 	/* This context's SWAP_CLUSTER_MAX. If freeing memory for
 	 * suspend, we effectively ignore SWAP_CLUSTER_MAX.
 	 * In this context, it doesn't matter that we scan the
@@ -1387,7 +1390,7 @@ static void get_scan_ratio(struct zone *
 	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
 
 	/* If we have no swap space, do not bother scanning anon pages. */
-	if (nr_swap_pages <= 0) {
+	if (!sc->may_swap || (nr_swap_pages <= 0)) {
 		percent[0] = 0;
 		percent[1] = 100;
 		return;
@@ -1704,6 +1707,7 @@ unsigned long try_to_free_pages(struct z
 		.may_writepage = !laptop_mode,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.may_unmap = 1,
+		.may_swap = 1,
 		.swappiness = vm_swappiness,
 		.order = order,
 		.mem_cgroup = NULL,
@@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
 	struct scan_control sc = {
 		.may_writepage = !laptop_mode,
 		.may_unmap = 1,
+		.may_swap = 1,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.swappiness = swappiness,
 		.order = 0,
@@ -1734,7 +1739,7 @@ unsigned long try_to_free_mem_cgroup_pag
 	struct zonelist *zonelist;
 
 	if (noswap)
-		sc.may_unmap = 0;
+		sc.may_swap = 0;
 
 	sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
 			(GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
@@ -1774,6 +1779,7 @@ static unsigned long balance_pgdat(pg_da
 	struct scan_control sc = {
 		.gfp_mask = GFP_KERNEL,
 		.may_unmap = 1,
+		.may_swap = 1,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.swappiness = vm_swappiness,
 		.order = order,
@@ -2120,6 +2126,7 @@ unsigned long shrink_all_memory(unsigned
 	struct scan_control sc = {
 		.gfp_mask = GFP_KERNEL,
 		.may_unmap = 0,
+		.may_swap = 1,
 		.may_writepage = 1,
 		.isolate_pages = isolate_pages_global,
 	};
@@ -2304,6 +2311,7 @@ static int __zone_reclaim(struct zone *z
 	struct scan_control sc = {
 		.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
 		.may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
+		.may_swap = 1,
 		.swap_cluster_max = max_t(unsigned long, nr_pages,
 					SWAP_CLUSTER_MAX),
 		.gfp_mask = gfp_mask,


--
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] 6+ messages in thread

* Re: [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap
  2009-04-18  6:26 [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap KOSAKI Motohiro
@ 2009-04-18 18:43 ` Johannes Weiner
  2009-04-19  8:59   ` KOSAKI Motohiro
  2009-04-19 12:42   ` [PATCH v3] " KOSAKI Motohiro
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Weiner @ 2009-04-18 18:43 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Daisuke Nishimura, LKML, linux-mm, Andrew Morton, Balbir Singh,
	KAMEZAWA Hiroyuki

Hi KOSAKI-san,

On Sat, Apr 18, 2009 at 03:26:02PM +0900, KOSAKI Motohiro wrote:
> Subject: vmscan,memcg: reintroduce sc->may_swap
> 
> vmscan-rename-scmay_swap-to-may_unmap.patch removed may_swap flag,
> but memcg had used it as a flag for "we need to use swap?", as the
> name indicate.
> 
> And in current implementation, memcg cannot reclaim mapped file caches
> when mem+swap hits the limit.
> 
> re-introduce may_swap flag and handle it at get_scan_ratio().
> This patch doesn't influence any scan_control users other than memcg.
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> --
>  mm/vmscan.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> Index: b/mm/vmscan.c
> ===================================================================
> --- a/mm/vmscan.c	2009-04-16 21:25:41.000000000 +0900
> +++ b/mm/vmscan.c	2009-04-16 21:56:54.000000000 +0900
> @@ -64,6 +64,9 @@ struct scan_control {
>  	/* Can mapped pages be reclaimed? */
>  	int may_unmap;
>  
> +	/* Can pages be swapped as part of reclaim? */
> +	int may_swap;
> +
>  	/* This context's SWAP_CLUSTER_MAX. If freeing memory for
>  	 * suspend, we effectively ignore SWAP_CLUSTER_MAX.
>  	 * In this context, it doesn't matter that we scan the
> @@ -1387,7 +1390,7 @@ static void get_scan_ratio(struct zone *
>  	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
>  
>  	/* If we have no swap space, do not bother scanning anon pages. */
> -	if (nr_swap_pages <= 0) {
> +	if (!sc->may_swap || (nr_swap_pages <= 0)) {

I wonder if may_swap is a good name for this effect.  See below the
__zone_reclaim() comments.

>  		percent[0] = 0;
>  		percent[1] = 100;
>  		return;
> @@ -1704,6 +1707,7 @@ unsigned long try_to_free_pages(struct z
>  		.may_writepage = !laptop_mode,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.may_unmap = 1,
> +		.may_swap = 1,
>  		.swappiness = vm_swappiness,
>  		.order = order,
>  		.mem_cgroup = NULL,
> @@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
>  	struct scan_control sc = {
>  		.may_writepage = !laptop_mode,
>  		.may_unmap = 1,
> +		.may_swap = 1,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.swappiness = swappiness,
>  		.order = 0,
> @@ -1734,7 +1739,7 @@ unsigned long try_to_free_mem_cgroup_pag
>  	struct zonelist *zonelist;
>  
>  	if (noswap)
> -		sc.may_unmap = 0;
> +		sc.may_swap = 0;

Can this be directly initialized?

struct scan_control sc = {
	...
	.may_swap = !noswap,
	...
};

>  	sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
>  			(GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
> @@ -1774,6 +1779,7 @@ static unsigned long balance_pgdat(pg_da
>  	struct scan_control sc = {
>  		.gfp_mask = GFP_KERNEL,
>  		.may_unmap = 1,
> +		.may_swap = 1,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.swappiness = vm_swappiness,
>  		.order = order,
> @@ -2120,6 +2126,7 @@ unsigned long shrink_all_memory(unsigned
>  	struct scan_control sc = {
>  		.gfp_mask = GFP_KERNEL,
>  		.may_unmap = 0,
> +		.may_swap = 1,

shrink_all_memory() is not a user of shrink_zone() -> get_scan_ratio()
and therefor not affected by this flag.  I think it's better not to
set it here (just like sc->swappiness).

>  		.may_writepage = 1,
>  		.isolate_pages = isolate_pages_global,
>  	};
> @@ -2304,6 +2311,7 @@ static int __zone_reclaim(struct zone *z
>  	struct scan_control sc = {
>  		.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
>  		.may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
> +		.may_swap = 1,

Shouldn't this be set to !!(zone_reclaim_mode & RECLAIM_SWAP) as well?

With set to 1, zone_reclaim() will also reclaim unmapped swap cache
pages (without swapping) and it might be desirable to do that.  But
then may_swap is a confusing name.  may_anon?  may_scan_anon?
scan_anon?

	Hannes

--
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] 6+ messages in thread

* Re: [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap
  2009-04-18 18:43 ` Johannes Weiner
@ 2009-04-19  8:59   ` KOSAKI Motohiro
  2009-04-19 11:34     ` KOSAKI Motohiro
  2009-04-19 12:42   ` [PATCH v3] " KOSAKI Motohiro
  1 sibling, 1 reply; 6+ messages in thread
From: KOSAKI Motohiro @ 2009-04-19  8:59 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Daisuke Nishimura, LKML, linux-mm, Andrew Morton, Balbir Singh,
	KAMEZAWA Hiroyuki

Hi

Hi

>> @@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
>>       struct scan_control sc = {
>>               .may_writepage = !laptop_mode,
>>               .may_unmap = 1,
>> +             .may_swap = 1,
>>               .swap_cluster_max = SWAP_CLUSTER_MAX,
>>               .swappiness = swappiness,
>>               .order = 0,
>> @@ -1734,7 +1739,7 @@ unsigned long try_to_free_mem_cgroup_pag
>>       struct zonelist *zonelist;
>>
>>       if (noswap)
>> -             sc.may_unmap = 0;
>> +             sc.may_swap = 0;
>
> Can this be directly initialized?
>
> struct scan_control sc = {
>        ...
>        .may_swap = !noswap,
>        ...
> };

your proposal is better coding style. but I also prefer condig style
consistency.
I think we should change may_unmap and may_swap at the same time.
Thus, I'd like to does it by another patch.



>> @@ -2120,6 +2126,7 @@ unsigned long shrink_all_memory(unsigned
>>       struct scan_control sc = {
>>               .gfp_mask = GFP_KERNEL,
>>               .may_unmap = 0,
>> +             .may_swap = 1,
>
> shrink_all_memory() is not a user of shrink_zone() -> get_scan_ratio()
> and therefor not affected by this flag.  I think it's better not to
> set it here (just like sc->swappiness).

Will fix. thanks.



>>               .may_writepage = 1,
>>               .isolate_pages = isolate_pages_global,
>>       };
>> @@ -2304,6 +2311,7 @@ static int __zone_reclaim(struct zone *z
>>       struct scan_control sc = {
>>               .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
>>               .may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
>> +             .may_swap = 1,
>
> Shouldn't this be set to !!(zone_reclaim_mode & RECLAIM_SWAP) as well?
>
> With set to 1, zone_reclaim() will also reclaim unmapped swap cache
> pages (without swapping) and it might be desirable to do that.

In general, you are right.
but another patch is better. this patch should only change memcg behavior.

I plan to change this. I'm making some zone reclaim test case, after it,
I can post the patch.


> But
> then may_swap is a confusing name.  may_anon?  may_scan_anon?
> scan_anon?

Why?
may_swap = 0 mean no swap-out directly. not anon only.
it's because shmem page stay in LRU_ANON.

--
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] 6+ messages in thread

* Re: [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap
  2009-04-19  8:59   ` KOSAKI Motohiro
@ 2009-04-19 11:34     ` KOSAKI Motohiro
  0 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2009-04-19 11:34 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Daisuke Nishimura, LKML, linux-mm, Andrew Morton, Balbir Singh,
	KAMEZAWA Hiroyuki

2009/4/19 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>:
> Hi
>
> Hi
>
>>> @@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
>>>       struct scan_control sc = {
>>>               .may_writepage = !laptop_mode,
>>>               .may_unmap = 1,
>>> +             .may_swap = 1,
>>>               .swap_cluster_max = SWAP_CLUSTER_MAX,
>>>               .swappiness = swappiness,
>>>               .order = 0,
>>> @@ -1734,7 +1739,7 @@ unsigned long try_to_free_mem_cgroup_pag
>>>       struct zonelist *zonelist;
>>>
>>>       if (noswap)
>>> -             sc.may_unmap = 0;
>>> +             sc.may_swap = 0;
>>
>> Can this be directly initialized?
>>
>> struct scan_control sc = {
>>        ...
>>        .may_swap = !noswap,
>>        ...
>> };
>
> your proposal is better coding style. but I also prefer condig style
> consistency.
> I think we should change may_unmap and may_swap at the same time.
> Thus, I'd like to does it by another patch.

Grr, I've misunderstood your comment.
Will fix as your suggestion.

--
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] 6+ messages in thread

* [PATCH v3] vmscan,memcg: reintroduce sc->may_swap
  2009-04-18 18:43 ` Johannes Weiner
  2009-04-19  8:59   ` KOSAKI Motohiro
@ 2009-04-19 12:42   ` KOSAKI Motohiro
  2009-04-20  6:41     ` Johannes Weiner
  1 sibling, 1 reply; 6+ messages in thread
From: KOSAKI Motohiro @ 2009-04-19 12:42 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: kosaki.motohiro, Daisuke Nishimura, LKML, linux-mm, Andrew Morton,
	Balbir Singh, KAMEZAWA Hiroyuki


next version here :)

==================================
Subject: [PATCH v3] vmscan,memcg: reintroduce sc->may_swap

vmscan-rename-scmay_swap-to-may_unmap.patch removed may_swap flag,
but memcg had used it as a flag for "we need to use swap?", as the
name indicate.

And in current implementation, memcg cannot reclaim mapped file caches
when mem+swap hits the limit.

re-introduce may_swap flag and handle it at get_scan_ratio().
This patch doesn't influence any scan_control users other than memcg.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
--
 mm/vmscan.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c	2009-04-17 21:39:58.000000000 +0900
+++ b/mm/vmscan.c	2009-04-19 20:33:00.000000000 +0900
@@ -64,6 +64,9 @@ struct scan_control {
 	/* Can mapped pages be reclaimed? */
 	int may_unmap;
 
+	/* Can pages be swapped as part of reclaim? */
+	int may_swap;
+
 	/* This context's SWAP_CLUSTER_MAX. If freeing memory for
 	 * suspend, we effectively ignore SWAP_CLUSTER_MAX.
 	 * In this context, it doesn't matter that we scan the
@@ -1387,7 +1390,7 @@ static void get_scan_ratio(struct zone *
 	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
 
 	/* If we have no swap space, do not bother scanning anon pages. */
-	if (nr_swap_pages <= 0) {
+	if (!sc->may_swap || (nr_swap_pages <= 0)) {
 		percent[0] = 0;
 		percent[1] = 100;
 		return;
@@ -1704,6 +1707,7 @@ unsigned long try_to_free_pages(struct z
 		.may_writepage = !laptop_mode,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.may_unmap = 1,
+		.may_swap = 1,
 		.swappiness = vm_swappiness,
 		.order = order,
 		.mem_cgroup = NULL,
@@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
 	struct scan_control sc = {
 		.may_writepage = !laptop_mode,
 		.may_unmap = 1,
+		.may_swap = !noswap,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.swappiness = swappiness,
 		.order = 0,
@@ -1733,9 +1738,6 @@ unsigned long try_to_free_mem_cgroup_pag
 	};
 	struct zonelist *zonelist;
 
-	if (noswap)
-		sc.may_unmap = 0;
-
 	sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
 			(GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
 	zonelist = NODE_DATA(numa_node_id())->node_zonelists;
@@ -1774,6 +1776,7 @@ static unsigned long balance_pgdat(pg_da
 	struct scan_control sc = {
 		.gfp_mask = GFP_KERNEL,
 		.may_unmap = 1,
+		.may_swap = 1,
 		.swap_cluster_max = SWAP_CLUSTER_MAX,
 		.swappiness = vm_swappiness,
 		.order = order,
@@ -2304,6 +2307,7 @@ static int __zone_reclaim(struct zone *z
 	struct scan_control sc = {
 		.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
 		.may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
+		.may_swap = 1,
 		.swap_cluster_max = max_t(unsigned long, nr_pages,
 					SWAP_CLUSTER_MAX),
 		.gfp_mask = gfp_mask,


--
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] 6+ messages in thread

* Re: [PATCH v3] vmscan,memcg: reintroduce sc->may_swap
  2009-04-19 12:42   ` [PATCH v3] " KOSAKI Motohiro
@ 2009-04-20  6:41     ` Johannes Weiner
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2009-04-20  6:41 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Daisuke Nishimura, LKML, linux-mm, Andrew Morton, Balbir Singh,
	KAMEZAWA Hiroyuki

On Sun, Apr 19, 2009 at 09:42:14PM +0900, KOSAKI Motohiro wrote:
> 
> next version here :)
> 
> ==================================
> Subject: [PATCH v3] vmscan,memcg: reintroduce sc->may_swap
> 
> vmscan-rename-scmay_swap-to-may_unmap.patch removed may_swap flag,
> but memcg had used it as a flag for "we need to use swap?", as the
> name indicate.
> 
> And in current implementation, memcg cannot reclaim mapped file caches
> when mem+swap hits the limit.
> 
> re-introduce may_swap flag and handle it at get_scan_ratio().
> This patch doesn't influence any scan_control users other than memcg.
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

> --
>  mm/vmscan.c |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> Index: b/mm/vmscan.c
> ===================================================================
> --- a/mm/vmscan.c	2009-04-17 21:39:58.000000000 +0900
> +++ b/mm/vmscan.c	2009-04-19 20:33:00.000000000 +0900
> @@ -64,6 +64,9 @@ struct scan_control {
>  	/* Can mapped pages be reclaimed? */
>  	int may_unmap;
>  
> +	/* Can pages be swapped as part of reclaim? */
> +	int may_swap;
> +
>  	/* This context's SWAP_CLUSTER_MAX. If freeing memory for
>  	 * suspend, we effectively ignore SWAP_CLUSTER_MAX.
>  	 * In this context, it doesn't matter that we scan the
> @@ -1387,7 +1390,7 @@ static void get_scan_ratio(struct zone *
>  	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
>  
>  	/* If we have no swap space, do not bother scanning anon pages. */
> -	if (nr_swap_pages <= 0) {
> +	if (!sc->may_swap || (nr_swap_pages <= 0)) {
>  		percent[0] = 0;
>  		percent[1] = 100;
>  		return;
> @@ -1704,6 +1707,7 @@ unsigned long try_to_free_pages(struct z
>  		.may_writepage = !laptop_mode,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.may_unmap = 1,
> +		.may_swap = 1,
>  		.swappiness = vm_swappiness,
>  		.order = order,
>  		.mem_cgroup = NULL,
> @@ -1724,6 +1728,7 @@ unsigned long try_to_free_mem_cgroup_pag
>  	struct scan_control sc = {
>  		.may_writepage = !laptop_mode,
>  		.may_unmap = 1,
> +		.may_swap = !noswap,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.swappiness = swappiness,
>  		.order = 0,
> @@ -1733,9 +1738,6 @@ unsigned long try_to_free_mem_cgroup_pag
>  	};
>  	struct zonelist *zonelist;
>  
> -	if (noswap)
> -		sc.may_unmap = 0;
> -
>  	sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
>  			(GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
>  	zonelist = NODE_DATA(numa_node_id())->node_zonelists;
> @@ -1774,6 +1776,7 @@ static unsigned long balance_pgdat(pg_da
>  	struct scan_control sc = {
>  		.gfp_mask = GFP_KERNEL,
>  		.may_unmap = 1,
> +		.may_swap = 1,
>  		.swap_cluster_max = SWAP_CLUSTER_MAX,
>  		.swappiness = vm_swappiness,
>  		.order = order,
> @@ -2304,6 +2307,7 @@ static int __zone_reclaim(struct zone *z
>  	struct scan_control sc = {
>  		.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
>  		.may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
> +		.may_swap = 1,
>  		.swap_cluster_max = max_t(unsigned long, nr_pages,
>  					SWAP_CLUSTER_MAX),
>  		.gfp_mask = gfp_mask,
> 
> 
> --
> 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>

--
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] 6+ messages in thread

end of thread, other threads:[~2009-04-20  6:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-18  6:26 [PATCH for mmotm 0414] vmscan,memcg: reintroduce sc->may_swap KOSAKI Motohiro
2009-04-18 18:43 ` Johannes Weiner
2009-04-19  8:59   ` KOSAKI Motohiro
2009-04-19 11:34     ` KOSAKI Motohiro
2009-04-19 12:42   ` [PATCH v3] " KOSAKI Motohiro
2009-04-20  6:41     ` Johannes Weiner

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