Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp701280pxu; Wed, 6 Jan 2021 01:53:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMbU49Owt9gN9qI6ZQdtbeufZbKg79cq6RQbTlqb3GebF/DaNiZl82RQr7FF2L7SL48p+U X-Received: by 2002:aa7:d846:: with SMTP id f6mr3429866eds.55.1609926800392; Wed, 06 Jan 2021 01:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609926800; cv=none; d=google.com; s=arc-20160816; b=g1nH8tUhc3l19N6v3TzTr9fm2RrrDeNUuEkp2rbBHq/6wtcSISAC9vBxm0BzCd1mNG a+GKtu5g3OHb1XA+b1LUNFoLNKvN9mthmmD0elp5FlarJz6jF9bVNLUuTvGb0rTm5aaN ir1dMsRuxZy4CfFMGryT3Asfckpflqpy+PvXROPaI7HC3Bj99l6803pvUeAdHPGbNliu pjMsDic/Zg/oc3nZCxxamjGdh8N4bZrZEVB8IwHzQHQoF/AY94Af0XZA4ZlHicqjHByw 5Xu5WPo8PxVeSgc3IJjzzfLJAZaSboNoXnYQDT82EG21ewZ9b/54VvrqL7WGILS+U+ZF Qg8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W0OTywhWfbLTNxAki2N8MQFvTOCjHX4ICZyvkpyBfr0=; b=A9HbKOPrQV9ckfHI9iFh7gTExG7ydhRJMMe9WuUb4LNniMHc4LNpmwHNMxepxQPnK5 rDR7D0ez8NZq7IOyIXAz8dnv/UOfpVC66E9f8CYPefxWKaDXuwJ6Oh3g212owyjvphXW sBhJCh5xWrA51BwgjOC9c6BAvBh/PlDUzH7tjAU9EnV/KN+8/C9U4RCsWjEwf8bSewwN 4hcTtJ9Oi920y0aqvMyRR/YJJY3SVeWZjrBG2X9BG8y0QtxuGY7vYAKOAM4QqrlId0jX TgsgOq7tnkGdUFzDgmDlEDxvfyBazG4z1A/sEEkxlE3SDePn9mPuJtFwbVAELZ7VAM9o cRqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Lhh+7CLT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 38si796511edr.163.2021.01.06.01.52.55; Wed, 06 Jan 2021 01:53:20 -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=@infradead.org header.s=casper.20170209 header.b=Lhh+7CLT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbhAFJvp (ORCPT + 99 others); Wed, 6 Jan 2021 04:51:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbhAFJvp (ORCPT ); Wed, 6 Jan 2021 04:51:45 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92F93C06134C for ; Wed, 6 Jan 2021 01:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=W0OTywhWfbLTNxAki2N8MQFvTOCjHX4ICZyvkpyBfr0=; b=Lhh+7CLTBFOALHM6dnNlkoW6wh L6hHVGZ4TVOJfmRetubHGjqsnn82leLcLVMExJhwjG1MXx4/B6/FIMa0GH7qQb3N2BC1DifyCMgal wvanuKAZhXh1Y1hRXIlUqxStgsob0tVxnyZs0g8W1wbHJZDLNGkMcTfrfcw68ply1BOW3ipl557P4 cMHlFoARI783btX2uzVqwzSnIW2kucdKuJDnlPgIm5I5Wcdp6sXPdfvdLrQ0WSuvuv39T7uNihwDd xxsxmpJS1g+dxgPC/Gd9s7jT2NABLad+aCnoDEqB4VSX/ey/bHLQ4JKaUnDNLZm/Wsb4pq0uBlIy+ /YK9alpQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1kx5RG-002CkE-PZ; Wed, 06 Jan 2021 09:49:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 72BDF3060AE; Wed, 6 Jan 2021 10:49:07 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 352092029F4C3; Wed, 6 Jan 2021 10:49:07 +0100 (CET) Date: Wed, 6 Jan 2021 10:49:07 +0100 From: Peter Zijlstra To: paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, yury.norov@gmail.com, kernel-team@fb.com, Paul Gortmaker Subject: Re: [PATCH RFC cpumask 4/5] cpumask: Add "last" alias for cpu list specifications Message-ID: References: <20210106004850.GA11682@paulmck-ThinkPad-P72> <20210106004956.11961-4-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210106004956.11961-4-paulmck@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2021 at 04:49:55PM -0800, paulmck@kernel.org wrote: > From: Paul Gortmaker > > It seems that a common configuration is to use the 1st couple cores > for housekeeping tasks, and or driving a busy peripheral that generates > a lot of interrupts, or something similar. > > This tends to leave the remaining ones to form a pool of similarly > configured cores to take on the real workload of interest to the user. > > So on machine A - with 32 cores, it could be 0-3 for "system" and then > 4-31 being used in boot args like nohz_full=, or rcu_nocbs= as part of > setting up the worker pool of CPUs. > > But then newer machine B is added, and it has 48 cores, and so while > the 0-3 part remains unchanged, the pool setup cpu list becomes 4-47. > > Deployment would be easier if we could just simply replace 31 and 47 > with "last" and let the system substitute in the actual number at boot; > a number that it knows better than we do. > > No need to have custom boot args per node, no need to do a trial boot > in order to snoop /proc/cpuinfo and/or /sys/devices/system/cpu - no > more fencepost errors of using 32 and 48 instead of 31 and 47. > > A generic token replacement is used to substitute "last" with the > number of CPUs present before handing off to bitmap processing. But > it could just as easily be used to replace any placeholder token with > any other token or value only known at/after boot. Aside from the comments Yury made, on how all this is better in bitmap_parselist(), how about doing s/last/N/ here? For me something like: "4-N" reads much saner than "4-last". Also, it might make sense to teach all this about core/node topology, but that's going to be messy. Imagine something like "Core1-CoreN" or "Nore1-NodeN" to mean the mask all/{Core,Node}0. And that is another feature that seems to be missing from parselist, all/except.