From: Yury Norov <yury.norov@gmail.com>
To: I Hsin Cheng <richard120310@gmail.com>
Cc: mark.rutland@arm.com, visitorckw@gmail.com,
linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org,
jserv@ccns.ncku.edu.tw
Subject: Re: [PATCH v3] cpumask: Rephrase comments for cpu_any*() APIs
Date: Fri, 17 Jan 2025 13:36:29 -0500 [thread overview]
Message-ID: <Z4qjLUqFc3_WUpUI@thinkpad> (raw)
In-Reply-To: <20250117142724.17657-1-richard120310@gmail.com>
On Fri, Jan 17, 2025 at 10:27:24PM +0800, I Hsin Cheng wrote:
> The cpu_any*() APIs comment states that it returns a "random" cpu within
> the given cpumask. However it's not actually random as random itself
> stands a meaning for uniform distribution.
>
> cpu_any*() APIs are a naming convention for the caller to states that it
There's no cpu_any* API. I replaced it with cpumask_any* and applied
in bitmap-for-next.
Thanks,
Yury
> doesn't care which CPU it gets, so change "random" to "arbitrary" would
> be more appropriate.
>
> Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
> Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> ---
> v1 -> v2:
> - Fix typo for Hoever/However
> - Drop quotes around 'arbitrary' word
>
> v2 -> v3:
> - Place changelogs in the correct position
>
> include/linux/cpumask.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 9278a50d5..93be218fc 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -391,7 +391,7 @@ unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int sta
> for_each_set_bit_from(cpu, cpumask_bits(mask), small_cpumask_bits)
>
> /**
> - * cpumask_any_but - return a "random" in a cpumask, but not this one.
> + * cpumask_any_but - return an arbitrary cpu in a cpumask, but not this one.
> * @mask: the cpumask to search
> * @cpu: the cpu to ignore.
> *
> @@ -411,7 +411,7 @@ unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
> }
>
> /**
> - * cpumask_any_and_but - pick a "random" cpu from *mask1 & *mask2, but not this one.
> + * cpumask_any_and_but - pick an arbitrary cpu from *mask1 & *mask2, but not this one.
> * @mask1: the first input cpumask
> * @mask2: the second input cpumask
> * @cpu: the cpu to ignore
> @@ -840,7 +840,7 @@ void cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
> }
>
> /**
> - * cpumask_any - pick a "random" cpu from *srcp
> + * cpumask_any - pick an arbitrary cpu from *srcp
> * @srcp: the input cpumask
> *
> * Return: >= nr_cpu_ids if no cpus set.
> @@ -848,7 +848,7 @@ void cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
> #define cpumask_any(srcp) cpumask_first(srcp)
>
> /**
> - * cpumask_any_and - pick a "random" cpu from *mask1 & *mask2
> + * cpumask_any_and - pick an arbitrary cpu from *mask1 & *mask2
> * @mask1: the first input cpumask
> * @mask2: the second input cpumask
> *
> --
> 2.43.0
next prev parent reply other threads:[~2025-01-17 18:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 14:27 [PATCH v3] cpumask: Rephrase comments for cpu_any*() APIs I Hsin Cheng
2025-01-17 18:36 ` Yury Norov [this message]
2025-01-18 7:37 ` Kuan-Wei Chiu
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=Z4qjLUqFc3_WUpUI@thinkpad \
--to=yury.norov@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mark.rutland@arm.com \
--cc=richard120310@gmail.com \
--cc=visitorckw@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