Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp611904pxu; Tue, 5 Jan 2021 22:35:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJymLAtYX7hZ1wvLCxeH/5c4qE2rfbMtKooBZoVtxQBe4Nb+9gKoj9rNEwFI4o3ZtsdvqiqY X-Received: by 2002:a05:6402:1b1e:: with SMTP id by30mr2912557edb.75.1609914940043; Tue, 05 Jan 2021 22:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609914940; cv=none; d=google.com; s=arc-20160816; b=R3MRbVdaeR6rbqjtQd8DexEXF0T+As3Spjah7pGuI0oCt/52Prk6u2kqn3vFK3pR9s c63R31X3aptrDLLdjZO/odA3DWXWOSRwFb84ooykEwhwFsmnLGL8b4iCVKTMQUbAFLnZ vdrgZ88DiGEKjDOKzGZxKTkg+qWdup4Jy/vvdo3wecsjwJbm4rxulxNrPtf+kKoL6JM/ UtPFnZFyvau1zKHGxXLO0IHzVH+RELGoStANU41v8wHr8FWdmfINJC5QgTqlHRdTKOS8 lUU522GJSBrtBVY8xr7TktSbc6BQ6Ga1ezTwbRlDfE1f+D2O0Ya4I/QVHYz/AKbX6yfh t3Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=D2T0nuiqZ51cyL88bRrJqH5KD+Rsokp1j/idw8L4Z2k=; b=Bzle12tmW5xDYfhjXKy4XN7h7AgIU0JHCA0BtB28tBN73PLZ50B1C4iaf7+5quKndJ eqUE34QHNSF2w/z23LpoEIs8pJ7KfxTjYNYIr8pp/vUOpl5J+0uF6XXR+Bc7SsUzfStM Sn+mrd5vLuPBbMv9gGHJpjlrq8bwF5ZxcxWfgTOztTFc3QCTUz0pGrkN48HpEgCdkVNN OGaSspo4txwMuKIoAnRFq8Lol28S3HPYkNW/IMWJhhCRTAxpRrjuAgDxmIGWHHWlveje yzmArG817eiYZdxj/+pvgXAqwHRMuDwvI67EbWMb+2XnA5nvsK8MEnRV1x3gJd1h8Sd9 xLAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QKSPDy2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si546238ejd.719.2021.01.05.22.35.16; Tue, 05 Jan 2021 22:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QKSPDy2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726238AbhAFGdo (ORCPT + 99 others); Wed, 6 Jan 2021 01:33:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbhAFGdo (ORCPT ); Wed, 6 Jan 2021 01:33:44 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D45DC06134C for ; Tue, 5 Jan 2021 22:33:03 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id n9so2235569ili.0 for ; Tue, 05 Jan 2021 22:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D2T0nuiqZ51cyL88bRrJqH5KD+Rsokp1j/idw8L4Z2k=; b=QKSPDy2ZTbkhVhckQQ42x04UuQib50pGNHr+cMccflrfxlG/+CN9CIjoIQ6jzuoizC 0FHrAZxmCdQvBJVqX8suCv1gYTEWvycLK30U+Td3tbO+yKAaMir/Td4etF4GCVhIcrPU CZlvvUrF1vSfrqDR1JmbWsDUG1kHS9hEEFWa2qJeOxj2tKFeH19t7jkkCuNfOy1FKFG1 OgIfQ1g5fJ+o3qet9dE7Lvo1/3JavFgXJKQVaoHuc/QdUE4VZd2gEeXAFiWh8OpE4gnr wiqKUwQzZdrLXwIsRWndOu6vngI7nhkuPx/alKnI/H3XFhpelA41iieNDajPsFFsjNW/ 4yQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D2T0nuiqZ51cyL88bRrJqH5KD+Rsokp1j/idw8L4Z2k=; b=tb+IIOVAQiasOqE7fEBhW/LOUp0rr9Bnr3sZeBYcQok6Imc975ofi94pgjBVOcINny 1VsArOgnGmQFvofJRDOmyHqcn8jUoUshXvqBWyTnvYO4g4/WtvBilrHQcry+qm/xCDhJ +vd0bboFugV2Y5SC4kA3A9Tdd5HgE8uskFPIlooeDykqeXWwxtbMW5fnGXnvtSlcAykz vh51ORDTef9Jxwi6Q+iE5YtV4hBBwCcSrw6fybCwKNNAo2TLdnqKzd5Na5C/rNUdK3uz 9+cCHU0uaijSToYpeSrYFqmSqmOpZTE9t0mDYRVfCeo8TsF2W5EMVJ1pJoEXn6AzTCx3 cznQ== X-Gm-Message-State: AOAM532UB7KCZHK5Hgih2Ip5gC8iJ0XaLOgVxSwqJy5/rEebMtlrps+H FBRrfihuw0xIX6GhWJMr4ArWRsTTyB5nrHNHB8w= X-Received: by 2002:a05:6e02:20c4:: with SMTP id 4mr2950339ilq.170.1609914782855; Tue, 05 Jan 2021 22:33:02 -0800 (PST) MIME-Version: 1.0 References: <20210106004850.GA11682@paulmck-ThinkPad-P72> <20210106004956.11961-2-paulmck@kernel.org> In-Reply-To: <20210106004956.11961-2-paulmck@kernel.org> From: Yury Norov Date: Tue, 5 Jan 2021 22:32:51 -0800 Message-ID: Subject: Re: [PATCH RFC cpumask 2/5] cpumask: Make "all" alias global and not just RCU To: paulmck@kernel.org Cc: Linux Kernel Mailing List , Peter Zijlstra , kernel-team@fb.com, Paul Gortmaker Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On Tue, Jan 5, 2021 at 4:49 PM wrote: > > From: Paul Gortmaker > > It is probably better that we don't have subsystem specific > abbreviations or aliases for generic CPU list specifications. > > Hence we move the "all" from RCU out to lib/ so that it can be > used in any instance where CPU lists are being parsed. > > Signed-off-by: Paul Gortmaker > Signed-off-by: Paul E. McKenney > --- > Documentation/admin-guide/kernel-parameters.rst | 7 +++++++ > Documentation/admin-guide/kernel-parameters.txt | 4 +--- > kernel/rcu/tree_plugin.h | 13 ++++--------- > lib/cpumask.c | 6 ++++++ > 4 files changed, 18 insertions(+), 12 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst > index 06fb1b4..cdf4e81 100644 > --- a/Documentation/admin-guide/kernel-parameters.rst > +++ b/Documentation/admin-guide/kernel-parameters.rst > @@ -68,6 +68,13 @@ For example one can add to the command line following parameter: > > where the final item represents CPUs 100,101,125,126,150,151,... > > +The following convenience aliases are also accepted and used: > + > + foo_cpus=all > + > +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. > > > This document may not be entirely up to date and comprehensive. The command > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index c722ec1..0f4379b 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4037,9 +4037,7 @@ > see CONFIG_RAS_CEC help text. > > rcu_nocbs= [KNL] > - The argument is a cpu list, as described above, > - except that the string "all" can be used to > - specify every CPU on the system. > + The argument is a cpu list, as described above. > > In kernels built with CONFIG_RCU_NOCB_CPU=y, set > the specified list of CPUs to be no-callback CPUs. > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index 7e291ce..642ebd6 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -1463,20 +1463,15 @@ static void rcu_cleanup_after_idle(void) > > /* > * Parse the boot-time rcu_nocb_mask CPU list from the kernel parameters. > - * The string after the "rcu_nocbs=" is either "all" for all CPUs, or a > - * comma-separated list of CPUs and/or CPU ranges. If an invalid list is > - * given, a warning is emitted and all CPUs are offloaded. > + * If the list is invalid, a warning is emitted and all CPUs are offloaded. > */ > static int __init rcu_nocb_setup(char *str) > { > alloc_bootmem_cpumask_var(&rcu_nocb_mask); > - if (!strcasecmp(str, "all")) > + if (cpulist_parse(str, rcu_nocb_mask)) { > + pr_warn("rcu_nocbs= bad CPU range, all CPUs set\n"); > cpumask_setall(rcu_nocb_mask); > - else > - if (cpulist_parse(str, rcu_nocb_mask)) { > - pr_warn("rcu_nocbs= bad CPU range, all CPUs set\n"); > - cpumask_setall(rcu_nocb_mask); > - } > + } > return 1; > } > __setup("rcu_nocbs=", rcu_nocb_setup); > diff --git a/lib/cpumask.c b/lib/cpumask.c > index 6e6e835..9f8ff72 100644 > --- a/lib/cpumask.c > +++ b/lib/cpumask.c > @@ -2,6 +2,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -104,6 +105,11 @@ EXPORT_SYMBOL(cpumask_next_wrap); > */ > int cpulist_parse(const char *buf, struct cpumask *dstp) > { > + if (!strcmp(buf, "all")) { > + cpumask_setall(dstp); > + return 0; > + } I like the extensions. Can you move this chunk inside bitmap_parselist() to let other users like nodelist_parse() use it? > return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits); > } > EXPORT_SYMBOL(cpulist_parse); > -- > 2.9.5 >