From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223F81A9B4C for ; Fri, 17 Jan 2025 18:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737138993; cv=none; b=Dw1XMrii9wOBxbaMXMBXqf5yjLSvnqwZV98oVjG+0Te6w5a7Ax9ONaqSqoZ/xv7b9/x5X13kE5d0tIj8FxUvGCS9s9vVwNCDi9OuwKWWUvrzHWuAiCD2YoRqSEGY9PwY/mtQJak483Dg+yOAnIstti7qPu/1H+y697J7JA9J5E0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737138993; c=relaxed/simple; bh=uXRkYlvMfhGKk2YKKXp63CYPQFA7fzy0EtjpycHZdQA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=imSK46+UfL00o64dKLs/lDm4n4KyhpV7QpXzcE8iw80kCYJBHEADMOEpxiRM0gWdNJfSNyYAcVX3usuSXlJ+5xxBtsL5C04CQy5lU1yu0Gwt4KQRFAsfI5MsiaIIKYehtySMf2e96AA2sqASzvhW5DccOSQ92UXyTr4mn2Hmkaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DZUgU6/h; arc=none smtp.client-ip=209.85.219.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DZUgU6/h" Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e3a1cfeb711so3881051276.0 for ; Fri, 17 Jan 2025 10:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737138991; x=1737743791; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AQu0/RToR7kd5Sj1Jv0zbeZnfoz1e0nLxFl1Oc5zS+U=; b=DZUgU6/hLiBmdBUwTCwPZUfF/yWA0V0zeL/zdwUMyVfumcRKtxqWs1ffpcF3gN4Gd1 wQyngfrjy0bu7n5AF1HQ3VVD/U1efMp4yVV3a6KrhoUOzBlaqv9eZswRMLi7YeG2pOs7 bgFhbwxR167o/L6MpwkBv4wNZWGhQkN+bofWMNhsNw4XpRMbbpYBoEum7WFOcIyDm8BM lytqSU3SUesMXCV8Lm2Xjf0gz3/lu8K288zXzImQOschEKTduhWX4+nVHC3TQbKWS5dI OW4qca/EN06Eoti4KvpA17C+L0BBaMXPvnEvGGZrKlhALuM2vmzA9hz/JUc+OoyGQ0aB k9Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138991; x=1737743791; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AQu0/RToR7kd5Sj1Jv0zbeZnfoz1e0nLxFl1Oc5zS+U=; b=LUJF4eqH/TBg9nX5AXYBLnG+pJUZi5nnshrEIRVYkhESKW50/j0b0adduvknVnYIZB AOQYo0ueCi8Ch6WoxTMJT3dSb75yLZkUEAKj8WnJ7z6o49J/vaYrzQoozjoiX4Hh0LGE ek43VxWHeq7+CeTVsWEwryYCwjXItwaI6FqHy973KOkb5YLM5skS6z5hCaD49TM+gdxi 2R1FRWM+EdINIrZ0l2YBO0rQYsa5FWbqxKX1b1AfjGG52fUXZvC630yqNTqdjq2CJbGt zirQwgNqm3Dmpas2J55aCTRByOqnYjFcj6nLm1JrlXpZYjkr7dSk6fpOgkFQJs0bqOHE aR2A== X-Forwarded-Encrypted: i=1; AJvYcCUCsuZbGqMcDUDsN73QTvyzjejo8U1tsl/n9EQQj4RDUnCqniOO+j4dyb5MlLMeCU4R+35yTgp32kfieeg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo7oNouwNiOzk1WPFS9Y98/HEvIoZmM0WLOkfO7F7IvXyQVx81 xpSFfoJimylhJY8sZoQX+rsQB8jkEHXs4DZWbJWf0Q/5tptzwUWE X-Gm-Gg: ASbGncs7tJQfq7mEcThc6eL6qLckM7sJMv9hmSgYkFAH5jth2nfR+pelRKFF6wbCQBd RdvppiI/IMWF3rskptGw7QDnTejMH57clFUkRyoxL5Yb+id1jhRdAcddwS7S0o77cFqQ3IYBBok /mM3YkywDYNabDXYLnykeHD/Q/TPHlN7cmZYgspQTPjAQaP3QhkvJtUXgVE11cnk9lWHl7TDVKi MmgyhOYUn3rqX6MUk7DlGUlShTDD3TGC8f7hachnWlit68q7RfzU4D6 X-Google-Smtp-Source: AGHT+IFjWYFwHesIVO/cF9Psz/feypljnRsFHKeb9eXI/39mbrIbiYYv3W81E3laZszBzZMjKflHRg== X-Received: by 2002:a05:690c:45c2:b0:6f4:6b13:45ce with SMTP id 00721157ae682-6f6eb66ec6bmr29532977b3.15.1737138990966; Fri, 17 Jan 2025 10:36:30 -0800 (PST) Received: from localhost ([2601:347:100:5ea0:5f67:767f:8925:4f3b]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f6e64745e9sm5185997b3.59.2025.01.17.10.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:36:30 -0800 (PST) Date: Fri, 17 Jan 2025 13:36:29 -0500 From: Yury Norov To: I Hsin Cheng 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 Message-ID: References: <20250117142724.17657-1-richard120310@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Reviewed-by: Kuan-Wei Chiu > --- > 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