Re: [PATCH v2] tracing/hwlat: Bind the sampler kthread instead of setting its affinity

From: Steven Rostedt

Date: Mon Nov 30 2026 - 11:49:53 EST


On Mon, 30 Nov 2026 10:12:02 +0800
Wenwu Hou <hwenwur@xxxxxxxxx> wrote:

> On Fri, Nov 27, 2026 at 11:00:37AM -0500, Steven Rostedt wrote:
> > On Thu, 26 Nov 2026 17:16:42 +0800
> > Wenwu Hou <hwenwur@xxxxxxxxx> wrote:
> >
> > > >
> > > > Right, the affinity should only be changed by the kernel if tracing_cpumask is
> > > > written. Otherwise it doesn't seem to make sense to let the user play with the
> > > > affinity.
> > >
> > > I agree. Perhaps v1 is better.
> >
> > A version of it. It needs to remove and prevent user space from modifying
> > the tasks affinity.
>
> v1 already leaves PF_NO_SETAFFINITY set for hwlatd via
> kthread_bind_mask(), which prevents userspace from changing the task's
> affinity. Is there anything else you would like removed or changed?
>

Yes, remove the code that Sashiko mentioned is useless with this change.

-- Steve