• Jupyung Lee's avatar
    softirqs: Add missing preemption point in ksoftirqd · ca0b4bfa
    Jupyung Lee authored
    In its current implementation, 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 task is woken up between (1) and (2) because it
    is not given a chance to preempt the currently running process until
    interrupts are enabled at (4). At this point the the kernel is
    preemptible, but there is no explicit reschedule point.
    
    This is only true for a preempt-rt enabled kernel as !preempt-rt has
    preemption disabled at that point via local_bh_disable().
    
    A simple suggestion to resolve the problem is to add a reschedule point,
    preempt_check_resched(), just after (4).
    
    [ tglx: Modified: delete __preempt_enable_no_resched() and add
      	preempt_enable() after local_irq_enable() ]
    Signed-off-by: default avatarJupyung Lee <jupyung@gmail.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    ca0b4bfa
softirq.c 29.8 KB