From: Steven Rostedt <rostedt@goodmis.org>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: Wenwu Hou <hwenwur@gmail.com>,
mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] tracing/hwlat: Bind the sampler kthread instead of setting its affinity
Date: Wed, 25 Nov 2026 10:38:22 -0500 [thread overview]
Message-ID: <20261125103822.2129a7ec@gandalf.local.home> (raw)
In-Reply-To: <awbklFE66PIMKFop@localhost.localdomain>
On Wed, 25 Nov 2026 14:37:24 +0100
Frederic Weisbecker <frederic@kernel.org> wrote:
> > static int kthread_fn(void *data)
> > {
> > + unsigned long flags;
> > u64 interval;
> >
> > + /*
> > + * kthread_bind_mask() sets PF_NO_SETAFFINITY to keep the initial
> > + * affinity from being overridden by kthread_affine_node(). Clear it
> > + * now to allow userspace affinity changes and cgroup migration, but
> > + * keep per-CPU threads bound to their CPUs.
> > + */
> > + if (hwlat_data.thread_mode != MODE_PER_CPU) {
> > + raw_spin_lock_irqsave(¤t->pi_lock, flags);
> > + current->flags &= ~PF_NO_SETAFFINITY;
> > + raw_spin_unlock_irqrestore(¤t->pi_lock, flags);
>
> This is not pretty but moreover, is it a good idea to let the user override
> that affinity?
No, but we used to. Perhaps we should make that not possible instead? :-/
-- Steve
prev parent reply other threads:[~2026-11-25 15:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 8:46 Wenwu Hou
2026-11-25 13:37 ` Frederic Weisbecker
2026-11-25 15:38 ` Steven Rostedt [this message]
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=20261125103822.2129a7ec@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=frederic@kernel.org \
--cc=hwenwur@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=stable@vger.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®