[-mm][PATCH 7/10] prevent incorrect oom under split_lru

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KOSAKI Motohiro
Date: Wednesday, June 25, 2008 - 3:07 am

if zone->recent_scanned parameter become inbalanceing anon and file,
OOM killer can happened although swappable page exist.

So, if priority==0, We should try to reclaim all page for prevent OOM.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>

---
 mm/vmscan.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1460,8 +1460,10 @@ static unsigned long shrink_zone(int pri
 			 * kernel will slowly sift through each list.
 			 */
 			scan = zone_page_state(zone, NR_LRU_BASE + l);
-			scan >>= priority;
-			scan = (scan * percent[file]) / 100;
+			if (priority) {
+				scan >>= priority;
+				scan = (scan * percent[file]) / 100;
+			}
 			zone->lru[l].nr_scan += scan + 1;
 			nr[l] = zone->lru[l].nr_scan;
 			if (nr[l] >= sc->swap_cluster_max)


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[-mm][PATCH 2/10] fix printk in show_free_areas(), KOSAKI Motohiro, (Wed Jun 25, 3:02 am)
[-mm][PATCH 7/10] prevent incorrect oom under split_lru, KOSAKI Motohiro, (Wed Jun 25, 3:07 am)
[-mm][PATCH 9/10] memcg: fix mem_cgroup_end_migration() race, KOSAKI Motohiro, (Wed Jun 25, 3:10 am)
Re: [-mm][PATCH 9/10] memcg: fix mem_cgroup_end_migration ..., Daisuke Nishimura, (Wed Jun 25, 3:53 am)
Re: [-mm][PATCH 0/10] memory related bugfix set for 2.6.2 ..., Lee Schermerhorn, (Wed Jun 25, 8:09 am)
Re: [-mm][PATCH 8/10] fix shmem page migration incorrectne ..., KAMEZAWA Hiroyuki, (Fri Jun 27, 1:52 am)
Re: [-mm][PATCH 8/10] fix shmem page migration incorrectne ..., Daisuke Nishimura, (Fri Jun 27, 2:29 am)