Re: must-fix list for 2.6.0

William Lee Irwin III
2003-05-01T04:19:47Z

William Lee Irwin III <wli@holomorphy.com> wrote:
>> With that in addition to the OOM killer locking patch I posted and
>> another to completely eliminate mm-less processes from consideration
>> 64GB ia32 (with, of course, my oversized out-of-tree patch) recovers
>> from OOM instead of deadlocking after a mass-killing with swap online.

On Tue, Apr 29, 2003 at 09:45:37PM -0700, Andrew Morton wrote:
> Wanna send patch?

out_of_memory() needs to check to be sure ZONE_NORMAL isn't exhausted.
In order to avoid potential regressions on non-highmem systems, make
the check (#ifdef-lessly) conditional on highmem support.

vs. current bk (which has the locking for oom's operational variables)

diff -prauN linux-2.5.68-9/mm/oom_kill.c oom-2.5.68-2/mm/oom_kill.c
--- linux-2.5.68-9/mm/oom_kill.c Wed Apr 23 03:15:53 2003
+++ oom-2.5.68-2/mm/oom_kill.c Wed Apr 30 21:06:48 2003
@@ -16,6 +16,7 @@
*/

#include <linux/mm.h>
+#include <linux/bootmem.h> /* for max_pfn and max_low_pfn */
#include <linux/sched.h>
#include <linux/swap.h>
#include <linux/timex.h>
@@ -217,9 +218,10 @@
unsigned long now, since;

/*
- * Enough swap space left? Not OOM.
+ * Enough swap space and ZONE_NORMAL left? Not OOM.
*/
- if (nr_swap_pages > 0)
+ if (nr_swap_pages > 0 &&
+ (max_pfn == max_low_pfn || nr_free_buffer_pages() > 0))
return;

spin_lock(&oom_lock);