lkml.org 
[lkml]   [2005]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRE: PATCH: Fix race in cpu_down (hotplug cpu)
    Date
    From
    Hi,
    >
    >On Mon, Sep 19, 2005 at 01:28:38PM +1000, Nigel Cunningham wrote:
    >> There is a race condition in taking down a cpu
    (kernel/cpu.c::cpu_down).
    >> A cpu can already be idling when we clear its online flag, and we do
    not
    >> force the idle task to reschedule. This results in __cpu_die timing
    out.
    >
    >"when we clear its online flag" - This happens in take_cpu_down in the
    >context of stopmachine thread. take_cpu_down also ensures that idle
    >thread runs when it returns (sched_idle_next). So when idle thread
    runs,
    >it should notice that it is offline and invoke play_dead. So I don't
    >understand why __cpu_die should time out.
    I guess Nigel's point is cpu_idle is preempted before take_cpu_down. If
    the preempt occurs after the cpu_is_offline check, when the cpu (after
    sched_idle_next) goes into idle again, nobody can wake it up. Nigel,
    isn't it?

    Thanks,
    Shaohua
    -
    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-09-19 06:51    [W:7.011 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site