From: Jakub Kicinski <kuba@kernel.org>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: "David S . Miller " <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
almasrymina@google.com, willemb@google.com, jdamato@fastly.com,
mkarsten@uwaterloo.ca, weiwan@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: stop napi kthreads when THREADED napi is disabled
Date: Tue, 13 May 2025 17:08:44 -0700 [thread overview]
Message-ID: <20250513170844.03ef5752@kernel.org> (raw)
In-Reply-To: <20250513002631.3155191-1-skhawaja@google.com>
On Tue, 13 May 2025 00:26:31 +0000 Samiullah Khawaja wrote:
> @@ -7463,6 +7482,15 @@ static int napi_thread_wait(struct napi_struct *napi)
> return 0;
> }
>
> + /* Since the SCHED_THREADED is not set so we do not own this
> + * napi and it is safe to stop here if we are asked to. Checking
> + * the SCHED_THREADED before stopping here makes sure that this
> + * napi was not schedule again while napi threaded was being
> + * disabled.
> + */
Not sure if this works:
CPU 0 (IRQ) CPU 1 (NAPI thr) CPU 2 (config)
____napi_schedule()
if (test_bit(NAPI_STATE_THREADED))
clear_bit(NAPI_STATE_THREADED)
kthread_stop(thread)
if (test_bit(NAPI_STATE_SCHED_THREADED))
..
if (kthread_should_stop())
exit
set_bit(NAPI_STATE_SCHED_THREADED)
wake_up_process(thread);
> + if (kthread_should_stop())
> + break;
> +
> schedule();
> set_current_state(TASK_INTERRUPTIBLE);
next prev parent reply other threads:[~2025-05-14 0:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 0:26 [PATCH net-next] net: stop napi kthreads when THREADED napi is disabled Samiullah Khawaja
2025-05-14 0:08 ` Jakub Kicinski [this message]
2025-05-14 16:31 ` Samiullah Khawaja
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=20250513170844.03ef5752@kernel.org \
--to=kuba@kernel.org \
--cc=almasrymina@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jdamato@fastly.com \
--cc=mkarsten@uwaterloo.ca \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhawaja@google.com \
--cc=weiwan@google.com \
--cc=willemb@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.