[lkml]   [2008]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[patch 46/47] hrtimer: prevent migration for raising softirq
    2.6.25-stable review patch.  If anyone has any objections, please let us

    From: Steven Rostedt <>

    commit ee3ece830f6db9837f7ac67008f532a8c1e755f4 upstream.

    Due to a possible deadlock, the waking of the softirq was pushed outside
    of the hrtimer base locks. See commit 0c96c5979a522c3323c30a078a70120e29b5bdbc

    Unfortunately this allows the task to migrate after setting up the softirq
    and raising it. Since softirqs run a queue that is per-cpu we may raise the
    softirq on the wrong CPU and this will keep the queued softirq task from

    To solve this issue, this patch disables preemption around the releasing
    of the hrtimer lock and raising of the softirq.

    Signed-off-by: Steven Rostedt <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Greg Kroah-Hartman <>

    kernel/hrtimer.c | 8 ++++++++
    1 file changed, 8 insertions(+)

    --- a/kernel/hrtimer.c
    +++ b/kernel/hrtimer.c
    @@ -896,10 +896,18 @@ hrtimer_start(struct hrtimer *timer, kti
    raise = timer->state == HRTIMER_STATE_PENDING;

    + /*
    + * We use preempt_disable to prevent this task from migrating after
    + * setting up the softirq and raising it. Otherwise, if me migrate
    + * we will raise the softirq on the wrong CPU.
    + */
    + preempt_disable();
    unlock_hrtimer_base(timer, &flags);

    if (raise)
    + preempt_enable();

    return ret;

     \ /
      Last update: 2008-07-23 01:37    [W:0.020 / U:57.360 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site