From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Jakub Kicinski <kuba@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Paolo Abeni <pabeni@redhat.com>, Wen Yang <wen.yang@linux.dev>
Subject: [PATCH 6.6 70/72] Revert "net: Allow to use SMP threads for backlog NAPI."
Date: Wed, 4 Feb 2026 15:41:13 +0100 [thread overview]
Message-ID: <20260204143848.181101080@linuxfoundation.org> (raw)
In-Reply-To: <20260204143845.603454952@linuxfoundation.org>
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This reverts commit f3652768a89cfdaedbe2c9384299eea7ec435fef which is
commit dad6b97702639fba27a2bd3e986982ad6f0db3a7 upstream.
It is only for issues around PREEMPT_RT, which is not in the 6.6.y tree,
so revert this for now.
Link: https://lore.kernel.org/r/20260120103833.4kssDD1Y@linutronix.de
Reported-by: Jakub Kicinski <kuba@kernel.org>
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Wen Yang <wen.yang@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/dev.c | 152 +++++++++++++--------------------------------------------
1 file changed, 37 insertions(+), 115 deletions(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -78,7 +78,6 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/sched/mm.h>
-#include <linux/smpboot.h>
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/string.h>
@@ -218,31 +217,6 @@ static inline struct hlist_head *dev_ind
return &net->dev_index_head[ifindex & (NETDEV_HASHENTRIES - 1)];
}
-#ifndef CONFIG_PREEMPT_RT
-
-static DEFINE_STATIC_KEY_FALSE(use_backlog_threads_key);
-
-static int __init setup_backlog_napi_threads(char *arg)
-{
- static_branch_enable(&use_backlog_threads_key);
- return 0;
-}
-early_param("thread_backlog_napi", setup_backlog_napi_threads);
-
-static bool use_backlog_threads(void)
-{
- return static_branch_unlikely(&use_backlog_threads_key);
-}
-
-#else
-
-static bool use_backlog_threads(void)
-{
- return true;
-}
-
-#endif
-
static inline void rps_lock_irqsave(struct softnet_data *sd,
unsigned long *flags)
{
@@ -4533,7 +4507,6 @@ EXPORT_SYMBOL(__dev_direct_xmit);
/*************************************************************************
* Receiver routines
*************************************************************************/
-static DEFINE_PER_CPU(struct task_struct *, backlog_napi);
int netdev_max_backlog __read_mostly = 1000;
EXPORT_SYMBOL(netdev_max_backlog);
@@ -4566,16 +4539,12 @@ static inline void ____napi_schedule(str
*/
thread = READ_ONCE(napi->thread);
if (thread) {
- if (use_backlog_threads() && thread == raw_cpu_read(backlog_napi))
- goto use_local_napi;
-
set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
wake_up_process(thread);
return;
}
}
-use_local_napi:
list_add_tail(&napi->poll_list, &sd->poll_list);
WRITE_ONCE(napi->list_owner, smp_processor_id());
/* If not called from net_rx_action()
@@ -4821,11 +4790,6 @@ static void napi_schedule_rps(struct sof
#ifdef CONFIG_RPS
if (sd != mysd) {
- if (use_backlog_threads()) {
- __napi_schedule_irqoff(&sd->backlog);
- return;
- }
-
sd->rps_ipi_next = mysd->rps_ipi_list;
mysd->rps_ipi_list = sd;
@@ -6049,7 +6013,7 @@ static void net_rps_action_and_irq_enabl
#ifdef CONFIG_RPS
struct softnet_data *remsd = sd->rps_ipi_list;
- if (!use_backlog_threads() && remsd) {
+ if (remsd) {
sd->rps_ipi_list = NULL;
local_irq_enable();
@@ -6064,7 +6028,7 @@ static void net_rps_action_and_irq_enabl
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
{
#ifdef CONFIG_RPS
- return !use_backlog_threads() && sd->rps_ipi_list;
+ return sd->rps_ipi_list != NULL;
#else
return false;
#endif
@@ -6108,7 +6072,7 @@ static int process_backlog(struct napi_s
* We can use a plain write instead of clear_bit(),
* and we dont need an smp_mb() memory barrier.
*/
- napi->state &= NAPIF_STATE_THREADED;
+ napi->state = 0;
again = false;
} else {
skb_queue_splice_tail_init(&sd->input_pkt_queue,
@@ -6774,48 +6738,43 @@ static void skb_defer_free_flush(struct
}
}
-static void napi_threaded_poll_loop(struct napi_struct *napi)
+static int napi_threaded_poll(void *data)
{
+ struct napi_struct *napi = data;
struct softnet_data *sd;
- unsigned long last_qs = jiffies;
+ void *have;
- for (;;) {
- bool repoll = false;
- void *have;
+ while (!napi_thread_wait(napi)) {
+ unsigned long last_qs = jiffies;
- local_bh_disable();
- sd = this_cpu_ptr(&softnet_data);
- sd->in_napi_threaded_poll = true;
+ for (;;) {
+ bool repoll = false;
- have = netpoll_poll_lock(napi);
- __napi_poll(napi, &repoll);
- netpoll_poll_unlock(have);
-
- sd->in_napi_threaded_poll = false;
- barrier();
-
- if (sd_has_rps_ipi_waiting(sd)) {
- local_irq_disable();
- net_rps_action_and_irq_enable(sd);
- }
- skb_defer_free_flush(sd);
- local_bh_enable();
+ local_bh_disable();
+ sd = this_cpu_ptr(&softnet_data);
+ sd->in_napi_threaded_poll = true;
+
+ have = netpoll_poll_lock(napi);
+ __napi_poll(napi, &repoll);
+ netpoll_poll_unlock(have);
+
+ sd->in_napi_threaded_poll = false;
+ barrier();
+
+ if (sd_has_rps_ipi_waiting(sd)) {
+ local_irq_disable();
+ net_rps_action_and_irq_enable(sd);
+ }
+ skb_defer_free_flush(sd);
+ local_bh_enable();
- if (!repoll)
- break;
+ if (!repoll)
+ break;
- rcu_softirq_qs_periodic(last_qs);
- cond_resched();
+ rcu_softirq_qs_periodic(last_qs);
+ cond_resched();
+ }
}
-}
-
-static int napi_threaded_poll(void *data)
-{
- struct napi_struct *napi = data;
-
- while (!napi_thread_wait(napi))
- napi_threaded_poll_loop(napi);
-
return 0;
}
@@ -11400,7 +11359,7 @@ static int dev_cpu_dead(unsigned int old
list_del_init(&napi->poll_list);
if (napi->poll == process_backlog)
- napi->state &= NAPIF_STATE_THREADED;
+ napi->state = 0;
else
____napi_schedule(sd, napi);
}
@@ -11408,14 +11367,12 @@ static int dev_cpu_dead(unsigned int old
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_enable();
- if (!use_backlog_threads()) {
#ifdef CONFIG_RPS
- remsd = oldsd->rps_ipi_list;
- oldsd->rps_ipi_list = NULL;
+ remsd = oldsd->rps_ipi_list;
+ oldsd->rps_ipi_list = NULL;
#endif
- /* send out pending IPI's on offline CPU */
- net_rps_send_ipi(remsd);
- }
+ /* send out pending IPI's on offline CPU */
+ net_rps_send_ipi(remsd);
/* Process offline CPU's input_pkt_queue */
while ((skb = __skb_dequeue(&oldsd->process_queue))) {
@@ -11678,38 +11635,6 @@ static struct pernet_operations __net_in
*
*/
-static int backlog_napi_should_run(unsigned int cpu)
-{
- struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
- struct napi_struct *napi = &sd->backlog;
-
- return test_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
-}
-
-static void run_backlog_napi(unsigned int cpu)
-{
- struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
-
- napi_threaded_poll_loop(&sd->backlog);
-}
-
-static void backlog_napi_setup(unsigned int cpu)
-{
- struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
- struct napi_struct *napi = &sd->backlog;
-
- napi->thread = this_cpu_read(backlog_napi);
- set_bit(NAPI_STATE_THREADED, &napi->state);
-}
-
-static struct smp_hotplug_thread backlog_threads = {
- .store = &backlog_napi,
- .thread_should_run = backlog_napi_should_run,
- .thread_fn = run_backlog_napi,
- .thread_comm = "backlog_napi/%u",
- .setup = backlog_napi_setup,
-};
-
/*
* This is called single threaded during boot, so no need
* to take the rtnl semaphore.
@@ -11760,10 +11685,7 @@ static int __init net_dev_init(void)
init_gro_hash(&sd->backlog);
sd->backlog.poll = process_backlog;
sd->backlog.weight = weight_p;
- INIT_LIST_HEAD(&sd->backlog.poll_list);
}
- if (use_backlog_threads())
- smpboot_register_percpu_thread(&backlog_threads);
dev_boot_phase = 0;
next prev parent reply other threads:[~2026-02-04 15:22 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 14:40 [PATCH 6.6 00/72] 6.6.123-rc1 review Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 01/72] Bluetooth: hci_uart: fix null-ptr-deref in hci_uart_write_work Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 02/72] net/mlx5: Fix memory leak in esw_acl_ingress_lgcy_setup() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 03/72] can: gs_usb: gs_usb_receive_bulk_callback(): fix error message Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 04/72] net: bcmasp: fix early exit leak with fixed phy Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 05/72] octeon_ep: Fix memory leak in octep_device_setup() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 06/72] bonding: annotate data-races around slave->last_rx Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 07/72] net: mvpp2: cls: Fix memory leak in mvpp2_ethtool_cls_rule_ins() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 08/72] ipv6: use the right ifindex when replying to icmpv6 from localhost Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 09/72] net: wwan: t7xx: fix potential skb->frags overflow in RX path Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 10/72] rocker: fix memory leak in rocker_world_port_post_fini() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 11/72] nfc: llcp: Fix memleak in nfc_llcp_send_ui_frame() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 12/72] ice: stop counting UDP csum mismatch as rx_errors Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 13/72] net/mlx5e: TC, delete flows only for existing peers Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 14/72] net/mlx5e: Report rx_discards_phy via rx_dropped Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 15/72] net/mlx5e: Account for netdev stats in ndo_get_stats64 Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 16/72] nfc: nci: Fix race between rfkill and nci_unregister_device() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 17/72] net: bridge: fix static key check Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 18/72] net/mlx5e: Skip ESN replay window setup for IPsec crypto offload Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 19/72] scsi: firewire: sbp-target: Fix overflow in sbp_make_tpg() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 20/72] ASoC: Intel: sof_es8336: fix headphone GPIO logic inversion Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 21/72] gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 22/72] dma/pool: distinguish between missing and exhausted atomic pools Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 23/72] pinctrl: meson: mark the GPIO controller as sleeping Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 24/72] riscv: compat: fix COMPAT_UTS_MACHINE definition Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 25/72] rust: kbuild: give `--config-path` to `rustfmt` in `.rsi` target Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 26/72] ASoC: fsl: imx-card: Do not force slot width to sample width Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 27/72] scsi: be2iscsi: Fix a memory leak in beiscsi_boot_get_sinfo() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 28/72] ASoC: amd: yc: Add DMI quirk for Acer TravelMate P216-41-TCO Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 29/72] gpio: pca953x: mask interrupts in irq shutdown Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 30/72] scsi: qla2xxx: edif: Fix dma_free_coherent() size Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 31/72] efivarfs: fix error propagation in efivar_entry_get() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 32/72] mptcp: only reset subflow errors when propagated Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 33/72] selftests: mptcp: check no dup close events after error Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 34/72] selftests: mptcp: check subflow errors in close events Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 35/72] selftests: mptcp: join: fix local endp not being tracked Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 36/72] flex_proportions: make fprop_new_period() hardirq safe Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 37/72] scripts: generate_rust_analyzer: Add compiler_builtins -> core dep Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 38/72] drm/imx/tve: fix probe device leak Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 39/72] drm/amdgpu/soc21: fix xclk for APUs Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 40/72] drm/amdgpu/gfx10: fix wptr reset in KGQ init Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 41/72] drm/amdgpu/gfx11: " Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 42/72] gpio: rockchip: Stop calling pinctrl for set_direction Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 43/72] mm/kfence: randomize the freelist on initialization Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 44/72] arm64/fpsimd: signal: Mandate SVE payload for streaming-mode state Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 45/72] arm64/fpsimd: signal: Consistently read FPSIMD context Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 46/72] arm64/fpsimd: signal: Fix restoration of SVE context Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 47/72] mei: trace: treat reg parameter as string Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 48/72] ksmbd: smbd: fix dma_unmap_sg() nents Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 49/72] drm/amdgpu: Replace Mutex with Spinlock for RLCG register access to avoid Priority Inversion in SRIOV Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 50/72] ksmbd: Fix race condition in RPC handle list access Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 51/72] wifi: mac80211: move TDLS work to wiphy work Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 52/72] wifi: ath11k: add srng->lock for ath11k_hal_srng_* in monitor mode Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 53/72] team: Move team device type change at the end of team_port_add Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 54/72] drm/radeon: delete radeon_fence_process in is_signaled, no deadlock Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 55/72] btrfs: prevent use-after-free on page private data in btrfs_subpage_clear_uptodate() Greg Kroah-Hartman
2026-02-04 14:40 ` [PATCH 6.6 56/72] net/sched: act_ife: convert comma to semicolon Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 57/72] ALSA: usb-audio: Fix missing unlock at error path of maxpacksize check Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 58/72] pinctrl: lpass-lpi: implement .get_direction() for the GPIO driver Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 59/72] drm/msm/a6xx: fix bogus hwcg register updates Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 60/72] perf: sched: Fix perf crash with new is_user_task() helper Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 61/72] writeback: fix 100% CPU usage when dirtytime_expire_interval is 0 Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 62/72] mptcp: avoid dup SUB_CLOSED events after disconnect Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 63/72] pinctrl: qcom: sm8350-lpass-lpi: Merge with SC7280 to fix I2S2 and SWR TX pins Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 64/72] drm/amdkfd: Dont use sw fault filter if retry cam enabled Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 65/72] drm/amdgpu: fix NULL pointer dereference in amdgpu_gmc_filter_faults_remove Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 66/72] xsk: Fix race condition in AF_XDP generic RX path Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 67/72] ksmbd: fix recursive locking in RPC handle list access Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 68/72] ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple() Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 69/72] drm/amd/display: use udelay rather than fsleep Greg Kroah-Hartman
2026-02-04 14:41 ` Greg Kroah-Hartman [this message]
2026-02-04 14:41 ` [PATCH 6.6 71/72] Revert "net: Remove conditional threaded-NAPI wakeup based on task state." Greg Kroah-Hartman
2026-02-04 14:41 ` [PATCH 6.6 72/72] bpf/selftests: test_select_reuseport_kern: Remove unused header Greg Kroah-Hartman
2026-02-04 19:52 ` [PATCH 6.6 00/72] 6.6.123-rc1 review Brett A C Sheffield
2026-02-04 20:01 ` Florian Fainelli
2026-02-04 20:27 ` Jon Hunter
2026-02-04 22:49 ` Peter Schneider
2026-02-05 7:46 ` Ron Economos
2026-02-05 8:28 ` Francesco Dolcini
2026-02-05 11:39 ` Mark Brown
2026-02-06 5:54 ` Shung-Hsi Yu
2026-02-06 9:25 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260204143848.181101080@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bigeasy@linutronix.de \
--cc=kuba@kernel.org \
--cc=pabeni@redhat.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=wen.yang@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox