lkml.org 
[lkml]   [2004]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectSuspend 2 merge:L 12/51: Disable OOM killer when suspending.
    From
    Date
    When preparing the image, suspend eats all the memory in sight, both to
    reduce the image size and to improve the reliability of our stats (We've
    worked hard to make it work reliably under heavy load - 100+). Of course
    this can result in the OOM killer being triggered, so this simple test
    stops that happening.

    diff -ruN 501-disable-oom-killer-when-suspending-old/mm/oom_kill.c 501-disable-oom-killer-when-suspending-new/mm/oom_kill.c
    --- 501-disable-oom-killer-when-suspending-old/mm/oom_kill.c 2004-11-03 21:53:47.000000000 +1100
    +++ 501-disable-oom-killer-when-suspending-new/mm/oom_kill.c 2004-11-04 16:27:40.000000000 +1100
    @@ -20,6 +20,7 @@
    #include <linux/swap.h>
    #include <linux/timex.h>
    #include <linux/jiffies.h>
    +#include <linux/suspend.h>

    /* #define DEBUG */

    @@ -237,6 +238,9 @@
    static unsigned long first, last, count, lastkill;
    unsigned long now, since;

    + if (test_suspend_state(SUSPEND_FREEZER_ON))
    + return;
    +
    spin_lock(&oom_lock);
    now = jiffies;
    since = now - last;

    -
    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 14:08    [W:3.144 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site