lkml.org 
[lkml]   [2004]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: 2.6.9-rc2-mm4

    could you try the patch below ontop of -mm4 and try again the .config
    that failed before? Does the bootup still hang?

    The early bootup stage is pretty fragile because the idle thread is not
    yet functioning as such and so we need preemption disabled. Whether the
    bootup fails or not seems to depend on timing details so e.g. the
    presence of SCHED_SMT makes it go away.

    disabling preemption explicitly has another advantage: the atomicity
    check in schedule() will catch early-bootup schedule() calls from now
    on.

    the patch also fixes another preempt-bkl buglet: interrupt-driven
    forced-preemption didnt go through preempt_schedule() so it resulted in
    auto-dropping of the BKL. Now we go through preempt_schedule() which
    properly deals with the BKL.

    Ingo

    Signed-off-by: Ingo Molnar <mingo@elte.hu>

    --- linux/init/main.c.orig
    +++ linux/init/main.c
    @@ -435,6 +435,12 @@ static void noinline rest_init(void)
    {
    kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
    numa_default_policy();
    + /*
    + * Re-enable preemption but disable interrupts to make sure
    + * we dont get preempted until we schedule() in cpu_idle().
    + */
    + local_irq_disable();
    + preempt_enable_no_resched();
    unlock_kernel();
    cpu_idle();
    }
    @@ -501,6 +507,7 @@ asmlinkage void __init start_kernel(void
    * time - but meanwhile we still have a functioning scheduler.
    */
    sched_init();
    + preempt_disable();
    build_all_zonelists();
    page_alloc_init();
    trap_init();
    --- linux/arch/i386/kernel/entry.S.orig
    +++ linux/arch/i386/kernel/entry.S
    @@ -197,10 +197,8 @@ need_resched:
    jz restore_all
    testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ?
    jz restore_all
    - movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp)
    sti
    - call schedule
    - movl $0,TI_preempt_count(%ebp)
    + call preempt_schedule
    cli
    jmp need_resched
    #endif
    -
    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:06    [W:4.088 / U:0.500 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site