[lkml]   [2002]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] kernel BUG at sched.c:944! only with CONFIG_PREEMPT=y]
    On Thu, 2002-09-12 at 16:20, Steven Cole wrote:

    > Yes. Sorry, didn't catch this reply until now.
    > I backed out Changeset 1.606 which Linus did to kernel/sched.c did this:
    > - if (unlikely(in_interrupt()))
    > + if (unlikely(in_atomic()))
    > and 2.5.34-mm2 was able to boot with CONFIG_PREEMPT=y.
    > As I said in a response to myself on lkml, I know this isn't a fix,
    > it just shows there is a problem somewhere with preempt.

    No, there is not a problem in preempt... what this change does is BUG()
    out if schedule() is called while being in any way non-atomic.

    While this sounds like a great debugging check, it is not useful in
    general since we surely have some bad code that calls schedule() with
    locks held. Further, since the atomic accounting only includes locks if
    CONFIG_PREEMPT is set, you only see this with kernel preemption enabled.

    Linus, please back this out... attached patch is against current BK.

    Yeah, I know we can change the BUG() to a show_stack() ... but I still
    think it will be too much and just deter people from using kernel
    preemption which is the opposite of what I want.

    Robert Love

    diff -urN linux-2.5.34/kernel/sched.c linux/kernel/sched.c
    --- linux-2.5.34/kernel/sched.c Thu Sep 12 16:26:23 2002
    +++ linux/kernel/sched.c Thu Sep 12 16:30:22 2002
    @@ -940,8 +940,7 @@
    struct list_head *queue;
    int idx;

    - if (unlikely(in_atomic()))
    - BUG();
    + BUG_ON(in_interrupt());


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:28    [W:0.024 / U:37.588 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site