lkml.org 
[lkml]   [2002]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] BUG(): sched.c: Line 944
    From
    Date
    Linus,

    The current in_atomic() check fails with kernel preemption enabled since
    we set preempt_count to PREEMPT_ACTIVE in preempt_schedule().

    We need to additionally check whether PREEMPT_ACTIVE is set.

    There is also still the issue that bugging out is a bit drastic and a
    hindrance to debugging; but I will tackle that later. For now, please
    apply this so we can at least boot with preemption enabled.

    Patch is against 2.5.35-bk.

    Robert Love

    diff -urN linux-2.5.35/kernel/sched.c linux/kernel/sched.c
    --- linux-2.5.35/kernel/sched.c Sun Sep 15 22:18:24 2002
    +++ linux/kernel/sched.c Mon Sep 16 14:43:54 2002
    @@ -940,8 +940,7 @@
    struct list_head *queue;
    int idx;

    - if (unlikely(in_atomic()))
    - BUG();
    + BUG_ON(in_atomic() && preempt_count() != PREEMPT_ACTIVE);

    #if CONFIG_DEBUG_HIGHMEM
    check_highmem_ptes();
    @@ -959,7 +958,7 @@
    * if entering off of a kernel preemption go straight
    * to picking the next task.
    */
    - if (unlikely(preempt_count() & PREEMPT_ACTIVE))
    + if (unlikely(preempt_count() == PREEMPT_ACTIVE))
    goto pick_next_task;

    switch (prev->state) {
    -
    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 13:28    [W:0.036 / U:1.108 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site