Re: [patch] oom-killer sysrq-f fix

From: Andrew Morton (akpm_at_osdl.org)
Date: 03/25/05

  • Next message: Adrian Bunk: "[2.6 patch] drivers/net/skfp/: cleanups"
    Date:	Thu, 24 Mar 2005 17:21:27 -0800
    To: Coywolf Qi Hunt <coywolf@lovecn.org>
    
    

    Coywolf Qi Hunt <coywolf@lovecn.org> wrote:
    >
    > >>--- 2.6.12-rc1-mm2/mm/oom_kill.c 2005-03-03 17:12:18.000000000 +0800
    > >>+++ 2.6.12-rc1-mm2-cy/mm/oom_kill.c 2005-03-25 08:07:19.000000000 +0800
    > >>@@ -20,6 +20,7 @@
    > >> #include <linux/swap.h>
    > >> #include <linux/timex.h>
    > >> #include <linux/jiffies.h>
    > >>+#include <linux/hardirq.h>
    > >>
    > >> /* #define DEBUG */
    > >>
    > >>@@ -283,6 +284,9 @@ retry:
    > >> if (mm)
    > >> mmput(mm);
    > >>
    > >>+ if (in_interrupt())
    > >>+ return;
    > >
    > >
    > > That'll make the whole feature a no-op, won't it?
    >
    > It won't be a no-op. I have tested it. It works well.
    > I pressed sysrq-f, loging bash got killed and I had to re-login.

    (looks)

    OK. But the patch is still deadlocky because we do task_lock() from
    interrupt context.

    > >
    > > The thing needs to be moved into process context via schedule_work(). I
    > > haven't got around to it yet.
    > >
    >
    > I don't think schedule_work() is a good option here. Since sysrq-f is emergent,
    > we just let oom-killer send SIGKILL in interrupt context and return.
    >
    > We needn't send SIGKILL in a process context. That'll be slow and [events] may got delayed.

    There isn't much choice. It should work OK - schedule_task doesn't
    allocate any memory.

    keventd could be off allocating some memory somewhere, in which case it
    could take some time to respond, but it isn't worth running another kernel
    thread for sysrq-f.
    -
    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/


  • Next message: Adrian Bunk: "[2.6 patch] drivers/net/skfp/: cleanups"

    Relevant Pages