linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [mmtom][BUGFIX] vmscan-second-chance-replacement-for-anonymous-pages-fix.patch
@ 2008-07-17  3:27 KAMEZAWA Hiroyuki
  2008-07-17 19:17 ` Balbir Singh
  0 siblings, 1 reply; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-07-17  3:27 UTC (permalink / raw)
  To: linux-mm; +Cc: LKML, Andrew Morton, riel, kosaki.motohiro

Under memcg, active anon tend not to go to inactive anon.
This will cause OOM in memcg easily when tons of anon was used at once.
This check was lacked in split-lru.

This patch is a fix agaisnt
vmscan-second-chance-replacement-for-anonymous-pages.patch


Changelog: v1 -> v2:
 - avoid adding "else".

Signed-off-by:KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>

 mm/vmscan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: mmtom-stamp-2008-07-15-15-39/mm/vmscan.c
===================================================================
--- mmtom-stamp-2008-07-15-15-39.orig/mm/vmscan.c
+++ mmtom-stamp-2008-07-15-15-39/mm/vmscan.c
@@ -1351,7 +1351,7 @@ static unsigned long shrink_zone(int pri
 	 * Even if we did not try to evict anon pages at all, we want to
 	 * rebalance the anon lru active/inactive ratio.
 	 */
-	if (scan_global_lru(sc) && inactive_anon_is_low(zone))
+	if (!scan_global_lru(sc) || inactive_anon_is_low(zone))
 		shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);
 
 	throttle_vm_writeout(sc->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] 2+ messages in thread

* Re: [mmtom][BUGFIX] vmscan-second-chance-replacement-for-anonymous-pages-fix.patch
  2008-07-17  3:27 [mmtom][BUGFIX] vmscan-second-chance-replacement-for-anonymous-pages-fix.patch KAMEZAWA Hiroyuki
@ 2008-07-17 19:17 ` Balbir Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Balbir Singh @ 2008-07-17 19:17 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: linux-mm, LKML, Andrew Morton, riel, kosaki.motohiro

KAMEZAWA Hiroyuki wrote:
> Under memcg, active anon tend not to go to inactive anon.
> This will cause OOM in memcg easily when tons of anon was used at once.
> This check was lacked in split-lru.
> 
> This patch is a fix agaisnt
> vmscan-second-chance-replacement-for-anonymous-pages.patch
> 
> 
> Changelog: v1 -> v2:
>  - avoid adding "else".
> 
> Signed-off-by:KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Acked-by: Rik van Riel <riel@redhat.com>
> 
>  mm/vmscan.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: mmtom-stamp-2008-07-15-15-39/mm/vmscan.c
> ===================================================================
> --- mmtom-stamp-2008-07-15-15-39.orig/mm/vmscan.c
> +++ mmtom-stamp-2008-07-15-15-39/mm/vmscan.c
> @@ -1351,7 +1351,7 @@ static unsigned long shrink_zone(int pri
>  	 * Even if we did not try to evict anon pages at all, we want to
>  	 * rebalance the anon lru active/inactive ratio.
>  	 */
> -	if (scan_global_lru(sc) && inactive_anon_is_low(zone))
> +	if (!scan_global_lru(sc) || inactive_anon_is_low(zone))
>  		shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);
> 
>  	throttle_vm_writeout(sc->gfp_mask);

I have not seen this, but looks good to me

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

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

end of thread, other threads:[~2008-07-17 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-17  3:27 [mmtom][BUGFIX] vmscan-second-chance-replacement-for-anonymous-pages-fix.patch KAMEZAWA Hiroyuki
2008-07-17 19:17 ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox