[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zg2EZ6II4QNuO/QM@yury-ThinkPad>
Date: Wed, 3 Apr 2024 09:31:35 -0700
From: Yury Norov <yury.norov@...il.com>
To: Dawei Li <dawei.li@...ngroup.cn>
Cc: will@...nel.org, mark.rutland@....com, linux@...musvillemoes.dk,
xueshuai@...ux.alibaba.com, renyu.zj@...ux.alibaba.com,
yangyicong@...ilicon.com, jonathan.cameron@...wei.com,
andersson@...nel.org, konrad.dybcio@...aro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH v3 01/10] cpumask: add cpumask_any_and_but()
On Wed, Apr 03, 2024 at 11:59:41PM +0800, Dawei Li wrote:
> From: Mark Rutland <mark.rutland@....com>
>
> In some cases, it's useful to be able to select a random cpu from the
> intersection of two masks, excluding a particular CPU.
>
> For example, in some systems an uncore PMU is shared by a subset of
> CPUs, and management of this PMU is assigned to some arbitrary CPU in
> this set. Whenever the management CPU is hotplugged out, we wish to
> migrate responsibility to another arbitrary CPU which is both in this
> set and online.
>
> Today we can use cpumask_any_and() to select an arbitrary CPU in the
> intersection of two masks. We can also use cpumask_any_but() to select
> any arbitrary cpu in a mask excluding, a particular CPU.
>
> To do both, we either need to use a temporary cpumask, which is
> wasteful, or use some lower-level cpumask helpers, which can be unclear.
>
> This patch adds a new cpumask_any_and_but() to cater for these cases.
>
> Signed-off-by: Mark Rutland <mark.rutland@....com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Rusty Russell <rusty@...tcorp.com.au>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Dawei Li <dawei.li@...ngroup.cn>
Thank you,
Acked-by: Yury Norov <yury.norov@...il.com>
Powered by blists - more mailing lists