Patch "net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-treat-__napi_schedule_irqoff-as-__napi_schedule-.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit de18527d252d0f210cf03e51fdd7de52288f58b6
Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Date:   Wed May 12 23:43:24 2021 +0200

    net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT
    
    [ Upstream commit 8380c81d5c4fced6f4397795a5ae65758272bbfd ]
    
    __napi_schedule_irqoff() is an optimized version of __napi_schedule()
    which can be used where it is known that interrupts are disabled,
    e.g. in interrupt-handlers, spin_lock_irq() sections or hrtimer
    callbacks.
    
    On PREEMPT_RT enabled kernels this assumptions is not true. Force-
    threaded interrupt handlers and spinlocks are not disabling interrupts
    and the NAPI hrtimer callback is forced into softirq context which runs
    with interrupts enabled as well.
    
    Chasing all usage sites of __napi_schedule_irqoff() is a whack-a-mole
    game so make __napi_schedule_irqoff() invoke __napi_schedule() for
    PREEMPT_RT kernels.
    
    The callers of ____napi_schedule() in the networking core have been
    audited and are correct on PREEMPT_RT kernels as well.
    
    Reported-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Reviewed-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/dev.c b/net/core/dev.c
index e226f266da9e..3810eaf89b26 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5972,11 +5972,18 @@ EXPORT_SYMBOL(napi_schedule_prep);
  * __napi_schedule_irqoff - schedule for receive
  * @n: entry to schedule
  *
- * Variant of __napi_schedule() assuming hard irqs are masked
+ * Variant of __napi_schedule() assuming hard irqs are masked.
+ *
+ * On PREEMPT_RT enabled kernels this maps to __napi_schedule()
+ * because the interrupt disabled assumption might not be true
+ * due to force-threaded interrupts and spinlock substitution.
  */
 void __napi_schedule_irqoff(struct napi_struct *n)
 {
-	____napi_schedule(this_cpu_ptr(&softnet_data), n);
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+		____napi_schedule(this_cpu_ptr(&softnet_data), n);
+	else
+		__napi_schedule(n);
 }
 EXPORT_SYMBOL(__napi_schedule_irqoff);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux