[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4TnM8jwgcMMd7Ft@visitorckw-System-Product-Name>
Date: Mon, 13 Jan 2025 18:13:07 +0800
From: Kuan-Wei Chiu <visitorckw@...il.com>
To: I Hsin Cheng <richard120310@...il.com>
Cc: yury.norov@...il.com, linux@...musvillemoes.dk, jserv@...s.ncku.edu.tw,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] cpumask: Implement "random" version of
cpumask_any_but()
Hi I Hsin,
On Mon, Jan 13, 2025 at 02:18:39PM +0800, I Hsin Cheng wrote:
> Original implementation of "cpumask_any_but()" isn't actually random as
> the comment claims itself to be. It's behavior is in fact to select the
> first cpu in "mask" which isn't equal to "cpu".
>
> Re-implement the function so we can choose a random cpu by randomly
> select the value of "n" and choose the nth cpu in "mask"
>
This patch may slow down the efficiency of cpumask_any_but(). Are there
any in-tree users of cpumask_any_but() that require it to return a
truly random id, or benefit from such behavior?
Regards,
Kuan-Wei
Powered by blists - more mailing lists