From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: I Hsin Cheng <richard120310@gmail.com>
Cc: yury.norov@gmail.com, linux@rasmusvillemoes.dk,
jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] cpumask: Implement "random" version of cpumask_any_but()
Date: Mon, 13 Jan 2025 18:13:07 +0800 [thread overview]
Message-ID: <Z4TnM8jwgcMMd7Ft@visitorckw-System-Product-Name> (raw)
In-Reply-To: <20250113061839.22131-1-richard120310@gmail.com>
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
next prev parent reply other threads:[~2025-01-13 10:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 6:18 [RFC PATCH] cpumask: Implement "random" version of cpumask_any_but() I Hsin Cheng
2025-01-13 10:13 ` Kuan-Wei Chiu [this message]
2025-01-13 10:27 ` I Hsin Cheng
2025-01-13 11:09 ` Kuan-Wei Chiu
2025-01-13 11:05 ` Mark Rutland
2025-01-13 18:00 ` Yury Norov
2025-01-14 7:15 ` I Hsin Cheng
2025-01-14 15:02 ` Mark Rutland
2025-01-14 15:43 ` Yury Norov
2025-01-15 7:24 ` I Hsin Cheng
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=Z4TnM8jwgcMMd7Ft@visitorckw-System-Product-Name \
--to=visitorckw@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=richard120310@gmail.com \
--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