From akpm@linux-foundation.org Thu Jul 2 12:51:13 2009 From: akpm@linux-foundation.org Date: Tue, 16 Jun 2009 16:42:53 -0700 Subject: Staging: android: lowmemorykiller.c: fix it for "oom: move oom_adj value from task_struct to mm_struct" To: greg@kroah.com Cc: akpm@linux-foundation.org, rientjes@google.com Message-ID: <200906162342.n5GNgrjj027586@imap1.linux-foundation.org> From: David Rientjes I'm about to merge "oom: move oom_adj value from task_struct to mm_struct", and this fixup is needed to repair linux-next's drivers/staging/android/lowmemorykiller.c. Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/lowmemorykiller.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -96,19 +96,21 @@ static int lowmem_shrink(int nr_to_scan, read_lock(&tasklist_lock); for_each_process(p) { + struct mm_struct *mm; int oom_adj; task_lock(p); - if (!p->mm) { + mm = p->mm; + if (!mm) { task_unlock(p); continue; } - oom_adj = p->oomkilladj; + oom_adj = mm->oom_adj; if (oom_adj < min_adj) { task_unlock(p); continue; } - tasksize = get_mm_rss(p->mm); + tasksize = get_mm_rss(mm); task_unlock(p); if (tasksize <= 0) continue;