From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1D9C433E6 for ; Wed, 6 Jan 2021 00:51:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7311F22227 for ; Wed, 6 Jan 2021 00:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727628AbhAFAul (ORCPT ); Tue, 5 Jan 2021 19:50:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:53354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbhAFAuj (ORCPT ); Tue, 5 Jan 2021 19:50:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D70E922DD3; Wed, 6 Jan 2021 00:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609894198; bh=WeDGqIHo+9q9HNBgyoOKDVhLdCzgAE48YybVm9P3H1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phMn1CoFywKGp3nEKwKrrS82Aa5tt7FbodIygqEMl42UHRL28edaxDRwKeXOFDHRo mblNYv6Jqi6nNkQCxOz/o2Bfq8lvsG7mxf0kRnV+36FQxKfIH7i6Q5pu4xsJvWyKG7 yQwEwZ93hGSE+LZBbWjrBpuQQR2N2GnlLRfGwRKoQyc4yaInzczu0l1ZnraJtvTEFU v2+H7vWPPd4bCjG5pLQz8v3USWJSrmNU4igN08mUU8leVSl/DAv6e3HueC7iJqoCKj np4AOe9Nisg7wdRCd22/mn6Hk5drDc6woQEJRWpKePxKbkSzOwVh8oKVXFyKKCcj6F vSGILMi3KUFDA== From: paulmck@kernel.org To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, yury.norov@gmail.com, kernel-team@fb.com, Paul Gortmaker , "Paul E . McKenney" Subject: [PATCH RFC cpumask 3/5] cpumask: Add a "none" alias to complement "all" Date: Tue, 5 Jan 2021 16:49:54 -0800 Message-Id: <20210106004956.11961-3-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20210106004850.GA11682@paulmck-ThinkPad-P72> References: <20210106004850.GA11682@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Gortmaker With global support for a CPU list alias of "all", it seems to just make sense to also trivially extend support for an opposite "none" specifier. Signed-off-by: Paul Gortmaker Signed-off-by: Paul E. McKenney --- Documentation/admin-guide/kernel-parameters.rst | 6 ++++++ lib/cpumask.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst index cdf4e81..7dd1224 100644 --- a/Documentation/admin-guide/kernel-parameters.rst +++ b/Documentation/admin-guide/kernel-parameters.rst @@ -76,6 +76,12 @@ is equivalent to "foo_cpus=0-N" -- where "N" is the numerically last CPU on the system, thus avoiding looking up the value in "/sys/devices/system/cpu" in advance on each deployed system. + foo_cpus=none + +will provide an empty/cleared cpu mask for the associated boot argument. + +Note that "all" and "none" are not necessarily valid/sensible input values +for each available parameter expecting a CPU list. This document may not be entirely up to date and comprehensive. The command "modinfo -p ${modulename}" shows a current list of all parameters of a loadable diff --git a/lib/cpumask.c b/lib/cpumask.c index 9f8ff72..7fbcab8 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -110,6 +110,11 @@ int cpulist_parse(const char *buf, struct cpumask *dstp) return 0; } + if (!strcmp(buf, "none")) { + cpumask_clear(dstp); + return 0; + } + return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits); } EXPORT_SYMBOL(cpulist_parse); -- 2.9.5