From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.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 0FC0525A654 for ; Fri, 17 Jan 2025 13:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737121726; cv=none; b=o3q6LFhuohmQYYbFJKn8lTUyd1OA/ECTiQGZ7Mxr9u6ati25W64cdy3X1pAzovxaL2VPckPnrUqv/zF+r1H4tg/nTvw4o7TbXcudyWTxM0x4lRF1lBguaAA36u5KPwaY/LcH4tkKVHewCJLoRudhlKLXoT4kTDOMLcPvTltEuyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737121726; c=relaxed/simple; bh=yRpts/EjF6NXOga+vYnIDg1k0Re7gwSxUT7gshZYbe0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b7hv7vcHdg3aclssS4OS9sNGe2wVHG41z9gK4eV0XyC5rwtnYHprgoyLLcY7IhmLVnpQuO5xBbMtxrT2Uk1pnqUc4LQn3tnaMsJQ7yKBcVmgNCixQjsxqMdlXhpLaFiB1leoBf/622xQgOyJYiMp/Qnp9BK6vddpVG1xD1IU3RE= 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=EYlc69i2; arc=none smtp.client-ip=209.85.214.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="EYlc69i2" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-21670dce0a7so47602225ad.1 for ; Fri, 17 Jan 2025 05:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737121724; x=1737726524; 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=SJjSHWmhjGiXf3b91rqKC1+6UfV00qDQfTlZ30JgypQ=; b=EYlc69i2INdUXUbDx5T2TbAKruq4TaCoD73k6cmJsXSjH1Tb5nWfHgyrDyvqyuXU4e ib+eKLPgvvX4K5mgsuyaDCpTMqXI54OtcDO6fqHee6JUp7sYpCnctFZ6riAB0K2OsBB1 7/Th4Fn9q19IgtJA+IX7XfARlKDWb+cwK8LogzPpnsQN9tkvrgh7NnUHU2buCCscFuu6 kvkU3ryPASSPkcnjVKd/ncGB+PdfVii9o957NnOf3q7inK5emd/+HaJMheDLJ8B5zJGS dA48IQg9lKVvVb+auFr/CH50O7FeyVukoR0TO8ax92FsRbCUM93tzx89pksSmVb9sjO4 4yCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121724; x=1737726524; 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=SJjSHWmhjGiXf3b91rqKC1+6UfV00qDQfTlZ30JgypQ=; b=E//YPnynVG4TpgpPo486V1aAlBTy9YhguPuG+IjiZn/Ncsiyx7FcM0JwFLyeMZhJxv tpnOTv2bPUDUlHfjcTFSixPIIdZv+xrHwKGIfr6myJt6t8ls88k8BRUqtNU8Z9yy38Gv ZhCpa5j9n9Myo92rtiAuGFQi4u1tISgF5NJP57FwigxKHuiUvpKj2B3e3PwzroCKsAg9 puglf3+3tpgknR2AoAIIcvV+m17EU5dIj0aogeK9H/AOFnE83gulnOx6N31MAMx7zye5 ++gNh3vFizumc3Zl38jwEemIe8dbAh26iajwFC+o6af1zVeE9lYesED+69/UK2fP+6qc nj0w== X-Forwarded-Encrypted: i=1; AJvYcCULMRJsx/F67C2ekSkXg5xS/GJlVqqvTqE0snaBxL1yu4Hpk51o1clZpZACVwSNNbkGMdhUUnfbKBlgaLQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwkpuFroIbdtMspB6urSXZO7/3oojj23FC0UjXfinZ+uIQn9ebH wiSrRlnJwR0s5Vq2cfa6WsDtNnz5LPSlVU9gj9ERtpNAR08BD/jx X-Gm-Gg: ASbGncs+xq7uQvkT49bGYdopdrBuAZ6ppwk55XvJinD/aEBUqjbRKPRpoiyYMQhJlM9 o7YciGnEsyoSS635vMD02OEpNjJTQHvmaTBgSo3LlE4T3UE3D6jrxDFTMNiodj4RAxC08+790bN cRtlxS8e1UWPhK8JcPsLNZtWeZtUsx1iF6DUoAQVqu7F0vKlpx6V80+9iCuXE42qH/8ufZih4nm FN5sKdH94VVpgtv7JVQU5AHMJ02bXrtaEgElevs5DlH/2WYee50wntFmgtbsxgN6Wzxcm5TVt37 G+OBnJjp X-Google-Smtp-Source: AGHT+IGqNRGFSFUyaijAtOuZ38I1oB+oIiVY59PRc1VhZbqumjkC1McLZi3+4T8f1Y2p7Q3T4gntTw== X-Received: by 2002:a17:903:98c:b0:216:3c36:69a7 with SMTP id d9443c01a7336-21c355f8f7amr47105595ad.45.1737121724126; Fri, 17 Jan 2025 05:48:44 -0800 (PST) Received: from visitorckw-System-Product-Name ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3e09d5sm15992435ad.170.2025.01.17.05.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:48:43 -0800 (PST) Date: Fri, 17 Jan 2025 21:48:39 +0800 From: Kuan-Wei Chiu To: I Hsin Cheng Cc: yury.norov@gmail.com, mark.rutland@arm.com, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org, jserv@ccns.ncku.edu.tw Subject: Re: [PATCH v2] cpumask: Rephrase comments for cpu_any*() APIs Message-ID: References: <20250117132313.17266-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: <20250117132313.17266-1-richard120310@gmail.com> Hi I Hsin, On Fri, Jan 17, 2025 at 09:23:13PM +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 > doesn't care which CPU it gets, so change "random" to "arbitrary" would > be more appropriate. > > v1 -> v2: > - Fix typo for Hoever/However > - Drop quotes around 'arbitrary' word Don't add changelogs between versions above the ---. Add them below it. Anything beyond --- will be part of the permanent changelog. > > Signed-off-by: I Hsin Cheng > Reviewed-by: Kuan-Wei Chiu > Reviewed-by: Mark Rutland > Reviewed-by: Yury Norov Correct me if I'm wrong, but Yury and Mark didn't explicitly give a Reviewed-by tag. Don't add any tags unless explicitly given. Regards, Kuan-Wei > --- > 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 >