Re: mmotm 2009-06-02-16-11 uploaded (staging)

From: David Rientjes
Date: Wed Jun 03 2009 - 00:45:31 EST


On Tue, 2 Jun 2009, Randy Dunlap wrote:

> drivers/staging/android/lowmemorykiller.c:106: error: 'struct task_struct' has no member named 'oomkilladj'
>

Thanks Randy.

This is due to oom-move-oom_adj-value-from-task_struct-to-mm_struct.patch
which was merged in mmotm early this morning.

I had previously fixed this in an earlier version of the patch series, but
people didn't agree that an oom killer change should touch staging files
even though the Android lowmemorykiller is in both mmotm and git HEAD.
See http://marc.info/?l=linux-kernel&m=124200164711314.

I'm still a little curious about why it was decided like that since it
seems to be the simplest way to avoid these failures, which leave you with
a broken build, and an unnecessary burden on maintainers to magically fix
them up later (which I guess is now?).

So when I moved oomkilladj from struct task_struct to struct mm_struct and
renamed it to something more appropriate, I still think I should have been
able to change drivers/staging/android/lowmemorykiller.c for those
reasons and avoid all of this hassle.

Anyway, here's a patch that should work and will hopefully now be
accepted. I know Greg is the maintainer for the staging tree and we're
talking about mmotm, but I don't know how else to do it anymore.
---
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -96,19 +96,21 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)

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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/