From: Christian Leber Ky box (2.6.9-final) was yesterday completly stalled (mouse movable and stupid loadmeter was still working) after starting mutt and was swapping for half an hour until I sent SIGTERM to all processes. I suspect it was a 2 GB big galeon process that was the problem. I think sysrq needs a key to call oom_kill manually. Signed-off-by: Andrew Morton --- 25-akpm/Documentation/sysrq.txt | 2 ++ 25-akpm/drivers/char/sysrq.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff -puN Documentation/sysrq.txt~make-sysrq-f-call-oom_kill Documentation/sysrq.txt --- 25/Documentation/sysrq.txt~make-sysrq-f-call-oom_kill Thu Mar 10 15:32:35 2005 +++ 25-akpm/Documentation/sysrq.txt Thu Mar 10 15:32:35 2005 @@ -92,6 +92,8 @@ On all - write a character to /proc/sys it so that only emergency messages like PANICs or OOPSes would make it to your console.) +'f' - Will call oom_kill to kill a memory hog process + 'e' - Send a SIGTERM to all processes, except for init. 'i' - Send a SIGKILL to all processes, except for init. diff -puN drivers/char/sysrq.c~make-sysrq-f-call-oom_kill drivers/char/sysrq.c --- 25/drivers/char/sysrq.c~make-sysrq-f-call-oom_kill Thu Mar 10 15:32:35 2005 +++ 25-akpm/drivers/char/sysrq.c Thu Mar 10 15:32:35 2005 @@ -31,7 +31,7 @@ #include #include #include /* for fsync_bdev() */ - +#include #include #include @@ -212,6 +212,18 @@ static struct sysrq_key_op sysrq_term_op .enable_mask = SYSRQ_ENABLE_SIGNAL, }; +static void sysrq_handle_moom(int key, struct pt_regs *pt_regs, + struct tty_struct *tty) +{ + out_of_memory(GFP_KERNEL); +// console_loglevel = 8; +} +static struct sysrq_key_op sysrq_moom_op = { + .handler = sysrq_handle_moom, + .help_msg = "Full", + .action_msg = "Manual OOM execution", +}; + static void sysrq_handle_kill(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { @@ -260,7 +272,7 @@ static struct sysrq_key_op *sysrq_key_ta /* c */ NULL, /* d */ NULL, /* e */ &sysrq_term_op, -/* f */ NULL, +/* f */ &sysrq_moom_op, /* g */ NULL, /* h */ NULL, /* i */ &sysrq_kill_op, _