1 diff -Nurp linux-2.6.22.10-vs2.3.0.29-pl05/init/Kconfig linux-2.6.22.10-vs2.3.0.29-pl06/init/Kconfig
2 --- linux-2.6.22.10-vs2.3.0.29-pl05/init/Kconfig 2007-09-29 08:11:49.000000000 -0400
3 +++ linux-2.6.22.10-vs2.3.0.29-pl06/init/Kconfig 2007-11-14 17:09:01.000000000 -0500
4 @@ -281,6 +281,23 @@ config LOG_BUF_SHIFT
12 + This option enables panic() to be called when a system is out of
13 + memory. This feature along with /proc/sys/kernel/panic allows a
14 + different behavior on out-of-memory conditions when the standard
15 + behavior (killing processes in an attempt to recover) does not
22 + depends on !OOM_PANIC
28 diff -Nurp linux-2.6.22.10-vs2.3.0.29-pl05/mm/oom_kill.c linux-2.6.22.10-vs2.3.0.29-pl06/mm/oom_kill.c
29 --- linux-2.6.22.10-vs2.3.0.29-pl05/mm/oom_kill.c 2007-10-29 21:23:59.000000000 -0400
30 +++ linux-2.6.22.10-vs2.3.0.29-pl06/mm/oom_kill.c 2007-11-14 17:09:01.000000000 -0500
31 @@ -169,6 +169,11 @@ unsigned long badness(struct task_struct
35 +#if defined(CONFIG_OOM_PANIC) && defined(CONFIG_OOM_KILLER)
36 +#warning Only define OOM_PANIC or OOM_KILLER; not both
39 +#ifdef CONFIG_OOM_KILLER
41 * Types of limitations to the nodes from which allocations may occur
43 @@ -481,3 +486,37 @@ out:
44 if (!test_thread_flag(TIF_MEMDIE))
45 schedule_timeout_uninterruptible(1);
47 +#endif /* CONFIG_OOM_KILLER */
49 +#ifdef CONFIG_OOM_PANIC
51 + * out_of_memory - panic if the system out of memory?
53 +void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
56 + * oom_lock protects out_of_memory()'s static variables.
57 + * It's a global lock; this is not performance-critical.
59 + static spinlock_t oom_lock = SPIN_LOCK_UNLOCKED;
60 + static unsigned long count;
62 + spin_lock(&oom_lock);
65 + * If we have gotten only a few failures,
66 + * we're not really oom.
68 + if (++count >= 10) {
70 + * Ok, really out of memory. Panic.
73 + printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
76 + panic("Out Of Memory");
78 + spin_unlock(&oom_lock);
80 +#endif /* CONFIG_OOM_PANIC */
81 diff -Nurp linux-2.6.22.10-vs2.3.0.29-pl05/mm/oom_panic.c linux-2.6.22.10-vs2.3.0.29-pl06/mm/oom_panic.c
82 --- linux-2.6.22.10-vs2.3.0.29-pl05/mm/oom_panic.c 1969-12-31 19:00:00.000000000 -0500
83 +++ linux-2.6.22.10-vs2.3.0.29-pl06/mm/oom_panic.c 2007-11-14 17:09:01.000000000 -0500
86 + * Just panic() instead of the default behavior of selecting processes
90 + * Modular OOM handlers for 2.6.4 (C) 2003,2004 Tvrtko A. Ursulin
92 + * linux/mm/oom_kill.c (C) 1998,2000 Rik van Riel.
94 + * Mark Huang <mlhuang@cs.princeton.edu>
96 + * $Id: oom_panic.c,v 1.1 2004/10/01 17:54:48 mlhuang Exp $
99 +#include <linux/mm.h>
100 +#include <linux/sched.h>
101 +#include <linux/swap.h>
104 + * out_of_memory - is the system out of memory?
106 +void out_of_memory(int gfp_mask)
109 + * oom_lock protects out_of_memory()'s static variables.
110 + * It's a global lock; this is not performance-critical.
112 + static spinlock_t oom_lock = SPIN_LOCK_UNLOCKED;
113 + static unsigned long count;
115 + spin_lock(&oom_lock);
118 + * If we have gotten only a few failures,
119 + * we're not really oom.
125 + * Ok, really out of memory. Panic.
128 + printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
131 + panic("Out Of Memory");
134 + spin_unlock(&oom_lock);