lkml.org 
[lkml]   [2009]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH-rt 1/1] softirqs: add preempt_check_resched() in ksoftirqd()
    Date
    In its current preempt-rt kernel, ksoftirq() includes a series of primitives
    related with kernel preemption and irq on/off, in the following order:

    preempt_disable() ... (1)
    local_irq_disable() ... (2)
    __preempt_enable_no_resched() ... (3)
    local_irq_enable() ... (4)

    A problem arises if a process is awakened between (1) and (2) because
    it is not given a chance to preempt the currently running process
    for a while since (4): since (4), the kernel is preemptible, but there
    is no explicit reschedule point.

    A simple suggestion to resolve the problem is to add a reschedule point,
    preempt_check_resched(), just after (4).

    Signed-off-by: Jupyung Lee <jupyung@gmail.com>
    ---
    kernel/softirq.c | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

    diff --git a/kernel/softirq.c b/kernel/softirq.c
    index 590049c..7c1b041 100644
    --- a/kernel/softirq.c
    +++ b/kernel/softirq.c
    @@ -1037,6 +1037,7 @@ sleep_more:
    set_softirq_pending(local_softirq_pending() & ~softirq_mask);
    local_bh_disable();
    local_irq_enable();
    + preempt_check_resched();

    h = &softirq_vec[data->nr];
    if (h)
    --
    1.5.4.3


    \
     
     \ /
      Last update: 2009-11-11 05:39    [W:4.309 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site