lkml.org 
[lkml]   [2001]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATH] Trigger OOM handler through sysrq
    The below patch allows you to trigger the OOM handler rather then the
    generic SAK. This may very well be the wrong way to do things, but
    I'm sure someone else will know the right way to do this. Apply this
    if you want to try another way of bringing back a thrashing system.

    Thanks,
    -Justin

    diff -urP sysrq.c.orig sysrq.c -u
    --- sysrq.c.orig Thu Aug 16 23:22:18 2001
    +++ sysrq.c Thu Aug 16 23:24:01 2001
    @@ -23,6 +23,7 @@
    #include <linux/quotaops.h>
    #include <linux/smp_lock.h>
    #include <linux/module.h>
    +#include <linux/swap.h>

    #include <asm/ptrace.h>

    @@ -137,6 +138,11 @@
    send_sig_all(SIGKILL, 1);
    orig_log_level = 8;
    break;
    + case 'f': /* F -- Free memory by invoking the oom handler */
    + printk("Free memory -- oom_kill()\n");
    + oom_kill();
    + break;
    +
    default: /* Unknown: help */
    if (kbd)
    printk("unRaw ");
    @@ -147,7 +153,7 @@
    printk("Boot ");
    if (sysrq_power_off)
    printk("Off ");
    - printk("Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n");
    + printk("Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL Freemem\n");
    /* Don't use 'A' as it's handled specially on the Sparc */
    }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 12:57    [W:0.024 / U:30.700 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site