From: Frederic Weisbecker <frederic@kernel.org>
To: Bradley Morgan <brads@mainlining.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Bradley Morgan <include@grrlz.net>, Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kthread: remove worker->task self-assignment
Date: Tue, 1 Sep 2026 16:06:51 +0200 [thread overview]
Message-ID: <apbb--idnSZMNLPU@localhost.localdomain> (raw)
In-Reply-To: <CE1F7435-D872-4A3F-BC7A-50443BBE2904@mainlining.org>
Le Tue, Sep 01, 2026 at 02:57:38PM +0100, Bradley Morgan a écrit :
> On 1 September 2026 13:49:00 BST, Peter Zijlstra <peterz@infradead.org>
> wrote:
> >On Tue, Sep 01, 2026 at 02:45:43PM +0200, Frederic Weisbecker wrote:
> >> Hi,
> >>
> >> Le Sat, Aug 29, 2026 at 04:18:48PM +0000, Bradley Morgan a écrit :
> >> > From: Bradley Morgan <brads@mainlining.org>
> >> >
> >> > All kthread worker users now create their workers with
> >> > kthread_create_worker*(), which sets worker->task before the worker
> >> > starts. The self-assignment in kthread_worker_fn() is dead code now.
> >>
> >> How could it be created before?
> >>
> >> >
> >> > Remove it.
> >> >
> >> > Signed-off-by: Bradley Morgan <brads@mainlining.org>
> >> > ---
> >> > kernel/kthread.c | 7 -------
> >> > 1 file changed, 7 deletions(-)
> >> >
> >> > diff --git a/kernel/kthread.c b/kernel/kthread.c
> >> > index 63beb59b7a3d..18bc702e8d2d 100644
> >> > --- a/kernel/kthread.c
> >> > +++ b/kernel/kthread.c
> >> > @@ -987,13 +987,6 @@ int kthread_worker_fn(void *worker_ptr)
> >> > struct kthread_worker *worker = worker_ptr;
> >> > struct kthread_work *work;
> >> >
> >> > - /*
> >> > - * FIXME: Update the check and remove the assignment when all kthread
> >> > - * worker users are created using kthread_create_worker*() functions.
> >> > - */
> >> > - WARN_ON(worker->task && worker->task != current);
> >>
> >> Should we keep a WARN_ON(worker->task != current) here?
> >
> >I vote yes! Paranoia is good :-)
> >
>
>
> Yeah, but it *should* be useless.
Famous last words :-)
> Do you really want me to readd the warn
> statement? Maybe add some text, like
>
> "worker->task is deprecated"?
Is it deprecated? We still need that field for wakeup on queue at least.
Don't bother with a message, it's only a sanity check.
Thanks.
>
> --- Thanks!
> https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/
--
Frederic Weisbecker
SUSE Labs
next prev parent reply other threads:[~2026-09-01 14:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 16:11 [RESEND PATCH 0/5] " Bradley Morgan
2026-08-29 16:13 ` [PATCH 1/5] media: ivtv: convert to kthread_run_worker Bradley Morgan
2026-08-29 16:15 ` [PATCH 2/5] net: encx24j600: " Bradley Morgan
2026-08-29 16:16 ` [PATCH 3/5] tty: sc16is7xx: " Bradley Morgan
2026-08-29 16:17 ` [PATCH 4/5] cpufreq: schedutil: convert to kthread_create_worker Bradley Morgan
2026-08-29 16:18 ` [PATCH] kthread: remove worker->task self-assignment Bradley Morgan
2026-09-01 12:45 ` Frederic Weisbecker
2026-09-01 12:49 ` Peter Zijlstra
2026-09-01 13:57 ` Bradley Morgan
2026-09-01 14:04 ` Bradley Morgan
2026-09-01 14:06 ` Frederic Weisbecker [this message]
2026-09-01 14:09 ` Bradley Morgan
2026-09-02 14:09 ` Frederic Weisbecker
2026-09-02 14:11 ` Bradley Morgan
2026-09-01 18:28 ` Bradley Morgan
2026-09-02 14:10 ` Frederic Weisbecker
-- strict thread matches above, loose matches on Subject: below --
2026-08-29 16:01 Bradley Morgan
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=apbb--idnSZMNLPU@localhost.localdomain \
--to=frederic@kernel.org \
--cc=brads@mainlining.org \
--cc=include@grrlz.net \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®