linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@kernel.org
Cc: linux-kernel@vger.kernel.org, yury.norov@gmail.com,
	kernel-team@fb.com, Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH RFC cpumask 4/5] cpumask: Add "last" alias for cpu list specifications
Date: Wed, 6 Jan 2021 10:49:07 +0100	[thread overview]
Message-ID: <X/WHk1hY3cmMAXQz@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210106004956.11961-4-paulmck@kernel.org>

On Tue, Jan 05, 2021 at 04:49:55PM -0800, paulmck@kernel.org wrote:
> From: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> It seems that a common configuration is to use the 1st couple cores
> for housekeeping tasks, and or driving a busy peripheral that generates
> a lot of interrupts, or something similar.
> 
> This tends to leave the remaining ones to form a pool of similarly
> configured cores to take on the real workload of interest to the user.
> 
> So on machine A - with 32 cores, it could be 0-3 for "system" and then
> 4-31 being used in boot args like nohz_full=, or rcu_nocbs= as part of
> setting up the worker pool of CPUs.
> 
> But then newer machine B is added, and it has 48 cores, and so while
> the 0-3 part remains unchanged, the pool setup cpu list becomes 4-47.
> 
> Deployment would be easier if we could just simply replace 31 and 47
> with "last" and let the system substitute in the actual number at boot;
> a number that it knows better than we do.
> 
> No need to have custom boot args per node, no need to do a trial boot
> in order to snoop /proc/cpuinfo and/or /sys/devices/system/cpu - no
> more fencepost errors of using 32 and 48 instead of 31 and 47.
> 
> A generic token replacement is used to substitute "last" with the
> number of CPUs present before handing off to bitmap processing.  But
> it could just as easily be used to replace any placeholder token with
> any other token or value only known at/after boot.

Aside from the comments Yury made, on how all this is better in
bitmap_parselist(), how about doing s/last/N/ here? For me something
like: "4-N" reads much saner than "4-last".

Also, it might make sense to teach all this about core/node topology,
but that's going to be messy. Imagine something like "Core1-CoreN" or
"Nore1-NodeN" to mean the mask all/{Core,Node}0.

And that is another feature that seems to be missing from parselist,
all/except.

  parent reply	other threads:[~2021-01-06  9:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  0:48 [PATCH RFC cpumask] Allow "all", "none", and "last" in cpumask strings Paul E. McKenney
2021-01-06  0:49 ` [PATCH RFC cpumask 1/5] cpumask: Un-inline cpulist_parse for SMP; prepare for ascii helpers paulmck
2021-01-06  0:49 ` [PATCH RFC cpumask 2/5] cpumask: Make "all" alias global and not just RCU paulmck
2021-01-06  6:32   ` Yury Norov
2021-01-06  0:49 ` [PATCH RFC cpumask 3/5] cpumask: Add a "none" alias to complement "all" paulmck
2021-01-06  6:59   ` Yury Norov
2021-01-06  0:49 ` [PATCH RFC cpumask 4/5] cpumask: Add "last" alias for cpu list specifications paulmck
2021-01-06  8:41   ` Yury Norov
2021-01-06  9:49   ` Peter Zijlstra [this message]
2021-01-06 17:45     ` Paul Gortmaker
2021-01-06 21:16     ` Yury Norov
2021-01-07 14:18       ` Peter Zijlstra
2021-01-07 14:47         ` Paul E. McKenney
2021-01-07 14:59           ` Peter Zijlstra
2021-01-07 15:32             ` Paul E. McKenney
2021-01-07 15:05         ` Paul E. McKenney
2021-01-06  0:49 ` [PATCH RFC cpumask 5/5] rcutorture: Use "all" and "last" in "nohz_full" and "rcu_nocbs" paulmck
2021-01-06  8:49 ` [PATCH RFC cpumask] Allow "all", "none", and "last" in cpumask strings Yury Norov
2021-01-21  7:11   ` Yury Norov
2021-01-21 16:57     ` Paul E. McKenney
2021-01-21 21:39       ` Paul E. McKenney
2021-01-21 22:42     ` Paul Gortmaker

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=X/WHk1hY3cmMAXQz@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@kernel.org \
    --cc=yury.norov@gmail.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;
as well as URLs for NNTP newsgroup(s).