#include <linux/notifier.h>
int sysctl_panic_on_oom;
-/* #define DEBUG */
+#define DEBUG
/**
* badness - calculate a numeric value for how bad this task has been
}
#ifdef DEBUG
- printk(KERN_DEBUG "OOMkill: task %d (%s) got %d points\n",
+ printk(KERN_INFO "OOMkill: task %d (%s) got %ld points\n",
p->pid, p->comm, points);
#endif
return points;
struct task_struct *p;
unsigned long points = 0;
unsigned long freed = 0;
+ int orig_log_level;
blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
if (freed > 0)
if (!should_oom_kill() && !force)
return;
+ orig_log_level = console_loglevel;
+ console_loglevel = 7;
+
if (printk_ratelimit()) {
printk(KERN_WARNING "%s invoked oom-killer: "
"gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
read_unlock(&tasklist_lock);
cpuset_unlock();
+ console_loglevel = orig_log_level;
+
/*
* Give "p" a good chance of killing itself before we
* retry to allocate memory unless "p" is current