[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8f5d3a92-f90c-4a0d-bd24-10dc49235afe@suse.cz>
Date: Tue, 6 Aug 2024 13:08:39 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>, Kees Cook <kees@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Thomas Gleixner <tglx@...utronix.de>,
Michal Hocko <mhocko@...nel.org>, linux-mm@...ck.org,
"Paul E. McKenney" <paulmck@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>, Boqun Feng <boqun.feng@...il.com>,
Zqiang <qiang.zhang1211@...il.com>, rcu@...r.kernel.org
Subject: Re: [RFC PATCH 12/20] kthread: Implement preferred affinity
On 8/6/24 01:59, Frederic Weisbecker wrote:
> On Mon, Aug 05, 2024 at 11:25:59PM +0200, Vlastimil Babka wrote:
>> > It's too bad we don't have a way to have a cpumask_possible_of_node(). I've
>> > looked into the guts of numa but that doesn't look easy to do.
>>
>> That was my impression as well. Maybe not even possible because exact cpu
>> ids might not be pre-determined like this?
>
> Probably.
>
>>
>> > Or there could be kthread_set_preferred_node()... ?
>>
>> Possible instead of the callback idea suggested above?
>> kthreads_hotplug_update() could check if this is set and construct the mask
>> accordingly.
>
> Or even better, callers of kthread_create_on_node() with actual node passed
> (!NUMA_NO_NODE) can be preferrably affined to the corresponding node by default
> unless told otherwise (that is unless kthread_bind() or
> kthread_set_preferred_affinity() has been called before the first wake up, and
> that includes kthread_create_on_cpu()).
Sounds logical and great!
> There are a few callers concerned: kswapd, kcompactd, some drivers:
> drivers/block/mtip32xx/mtip32xx.c, drivers/firmware/stratix10-svc.c,
> kernel/dma/map_benchmark.c, net/sunrpc/svc.c
>
> After all kthread_create_on_cpu() affines to the corresponding CPU. So
> it sounds natural that kthread_create_on_node() affines to the corresponding
> node.
Yes.
> And then it's handled on hotplug just as a special case of preferred affinity.
>
> Or is there something that wouldn't make that work?
Hopefully not.
> Thanks.
>
>
>>
>> > Thanks.
>> >
>> >>
>> >> > Thanks.
>> >>
>>
Powered by blists - more mailing lists