public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Xi Wang <xii@google.com>
Cc: "Tejun Heo" <tj@kernel.org>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>,
	"David Rientjes" <rientjes@google.com>,
	"Mel Gorman" <mgorman@suse.de>,
	"Valentin Schneider" <vschneid@redhat.com>,
	"Waiman Long" <longman@redhat.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	"Chen Yu" <yu.c.chen@intel.com>, "Kees Cook" <kees@kernel.org>,
	"Yu-Chun Lin" <eleanor15x@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Mickaël Salaün" <mic@digikod.net>,
	jiangshanlai@gmail.com
Subject: Re: [RFC/PATCH] sched: Support moving kthreads into cpuset cgroups
Date: Thu, 8 May 2025 02:08:32 +0200	[thread overview]
Message-ID: <aBv2AG-VbZ4gcWpi@pavilion.home> (raw)
In-Reply-To: <CAOBoifiv2GCeeDjax8Famu7atgkGNV0ZxxG-cfgvC857-dniqA@mail.gmail.com>

Le Wed, May 07, 2025 at 01:07:16PM -0700, Xi Wang a écrit :
> On Wed, May 7, 2025 at 10:36 AM Tejun Heo <tj@kernel.org> wrote:
> >
> > Hello,
> >
> > On Wed, May 07, 2025 at 10:23:24AM -0700, Xi Wang wrote:
> > > Overall I think your arguments depend on kernel and application threads are
> > > significantly different for cpu affinity management, but there isn't enough
> > > evidence for it. If cpuset is a bad idea for kernel threads it's probably not
> > > a good idea for user threads either. Maybe we should just remove cpuset from
> > > kernel and let applications threads go with boot time global variables and
> > > set their own cpu affinities.
> >
> > I can't tell whether you're making a good faith argument. Even if you are,
> > you're making one bold claim without much substance and then jumping to the
> > other extreme based on that. This isn't a productive way to discuss these
> > things.
> >
> > Thanks.
> >
> > --
> > tejun
> 
> Yes this is still serious technical discussion. Frederic made several "we can't
> have b because we already have / are working on a" statements which were not
> very actionable. Deducing to a particular case is a quick way to simplify.

I referred to a particular case (isolation) because you said this is your
usecase. You still haven't explained us why the current affinity management for
kthreads doesn't work for you.

> I'd prefer to focus more on higher level technical tradeoffs.
> 
> Overall compartmentalization limits resource (cpu) sharing which limits
> overcommit thus efficiency.
> cpumask restrictions are not ideal but sometimes
> necessary. Dynamically configurable cpumasks are better than statically
> reserved cpus.

For which usecase?

> I do think the cgroup tree structure sometimes helps and we don't have to use
> it for all cases.

Also kernel threads are special beasts, even some !PF_NO_SETAFFINTIY kthreads
have actual affinity preferences. If they can go through cpusets, this must be
dealt with. And admins will need to know about those affinity preferences for
each kthreads.

Also do we want to be able to expose all the cgroup limits to kthreads? Even
if only cpusets is allowed to have kthreads, does cpusets.mems make
sense to be exposed for example?

If your issue is ever resolved through cpusets, this will have to be maintained
forever with all those subtleties in mind.

I tend to think that CPU isolation is a very straightforward cpusets usecase:
no load balancing, NULL domains and tasks usually don't compete much for the
CPU since the point is to not be disturbed anyway.

And NULL domains already exclude kernel threads, dynamically. So please give
us a compelling reason for doing this.

Thanks.

-- 
Frederic Weisbecker
SUSE Labs

  reply	other threads:[~2025-05-08  0:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 18:35 [RFC/PATCH] sched: Support moving kthreads into cpuset cgroups Xi Wang
2025-05-06 19:57 ` Waiman Long
2025-05-06 23:15   ` Xi Wang
2025-05-07  0:17 ` Tejun Heo
2025-05-07  3:43   ` Xi Wang
2025-05-07 14:11     ` Frederic Weisbecker
2025-05-07 17:23       ` Xi Wang
2025-05-07 17:36         ` Tejun Heo
2025-05-07 20:07           ` Xi Wang
2025-05-08  0:08             ` Frederic Weisbecker [this message]
2025-05-08 17:51               ` Xi Wang
2025-05-08 19:34                 ` Waiman Long
2025-05-08 22:39                   ` Xi Wang
2025-05-09  0:30                     ` Waiman Long
2025-05-09 16:52                       ` Xi Wang
2025-05-12 10:36 ` Michal Koutný
2025-05-12 18:55   ` Xi Wang

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=aBv2AG-VbZ4gcWpi@pavilion.home \
    --to=frederic@kernel.org \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=eleanor15x@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=jiangshanlai@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mic@digikod.net \
    --cc=mingo@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=xii@google.com \
    --cc=yu.c.chen@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox