The patch titled oom-kill: mm locking fix has been added to the -mm tree. Its filename is oom-kill-mm-locking-fix.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this From: Andrew Morton <akpm@xxxxxxxx> Dave Peterson <dsp@xxxxxxxx> points out that badness() is playing with mm_structs without taking a reference on them. mmput() can sleep, so taking a reference here (inside tasklist_lock) is hard. Fix it up via task_lock() instead. Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/oom_kill.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff -puN mm/oom_kill.c~oom-kill-mm-locking-fix mm/oom_kill.c --- 25/mm/oom_kill.c~oom-kill-mm-locking-fix Fri Apr 14 14:31:29 2006 +++ 25-akpm/mm/oom_kill.c Fri Apr 14 14:31:29 2006 @@ -47,15 +47,25 @@ int sysctl_panic_on_oom; unsigned long badness(struct task_struct *p, unsigned long uptime) { unsigned long points, cpu_time, run_time, s; - struct list_head *tsk; + struct mm_struct *mm; + struct task_struct *child; - if (!p->mm) + task_lock(p); + mm = p->mm; + if (!mm) { + task_unlock(p); return 0; + } /* * The memory size of the process is the basis for the badness. */ - points = p->mm->total_vm; + points = mm->total_vm; + + /* + * After this unlock we can no longer dereference local variable `mm' + */ + task_unlock(p); /* * Processes which fork a lot of child processes are likely @@ -65,11 +75,11 @@ unsigned long badness(struct task_struct * child is eating the vast majority of memory, adding only half * to the parents will make the child our kill candidate of choice. */ - list_for_each(tsk, &p->children) { - struct task_struct *chld; - chld = list_entry(tsk, struct task_struct, sibling); - if (chld->mm != p->mm && chld->mm) - points += chld->mm->total_vm/2 + 1; + list_for_each_entry(child, &p->children, sibling) { + task_lock(child); + if (child->mm != mm && child->mm) + points += child->mm->total_vm/2 + 1; + task_unlock(child); } /* _ Patches currently in -mm which might be from akpm@xxxxxxxx are origin.patch config_net=n-build-fix.patch git-acpi.patch acpi-update-asus_acpi-driver-registration-fix.patch acpi-memory-hotplug-cannot-manage-_crs-with-plural-resoureces.patch catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch sony_apci-resume.patch git-audit-master-fixup.patch powernow-k8-crash-workaround.patch git-drm.patch git-dvb.patch git-dvb-compat-build-fix.patch bt866-build-fix.patch connector-exports.patch pci-error-recovery-e1000-network-device-driver.patch git-pcmcia.patch git-scsi-misc.patch megaraid-unused-variable.patch git-sas-jg.patch git-sas-jg-build-hack.patch git-splice-fixup.patch git-watchdog.patch arm-add_memory-build-fix.patch pg_uncached-is-ia64-only.patch migration-remove-unnecessary-pageswapcache-checks-fix.patch wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes.patch oom-kill-mm-locking-fix.patch page_allocc-buddy-handling-cleanup.patch acx1xx-wireless-driver.patch prune_one_dentry-tweaks.patch fix-cdrom-being-confused-on-using-kdump-tweaks.patch mmput-might-sleep.patch tpm-use-clear_bit-fix.patch tpm-use-clear_bit-fix-fix.patch tpm-use-clear_bit-fix-fix-fix-fix.patch hangcheck-remove-monotomic_clock-on-x86.patch pi-futex-futex-code-cleanups-fix.patch reiser4.patch kgdb-core-lite-add-reboot-command.patch kgdb-8250-fix.patch nr_blockdev_pages-in_interrupt-warning.patch device-suspend-debug.patch revert-tty-buffering-comment-out-debug-code.patch slab-leaks3-default-y.patch x86-kmap_atomic-debugging.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html