Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1992183rda; Tue, 24 Oct 2023 09:06:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELnvIigkQfC0ZZBw/eHPTTaw2fWUat79XwGqIhEqmCpNPiHqWkycL4Gqm4xsn+IniBPg6H X-Received: by 2002:a17:902:ecc6:b0:1c9:cc41:76e4 with SMTP id a6-20020a170902ecc600b001c9cc4176e4mr10223892plh.10.1698163569985; Tue, 24 Oct 2023 09:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698163569; cv=none; d=google.com; s=arc-20160816; b=azRrvMPovZAUoY0imTJ1PUQ4BkoxjEoN/V0eNb/wf2412kCAqNmQs70g7NI/FFQe7V FbodqSNvYrYcGgqi/L4QUtAN0KRP2yQ9wQVPtEmZP0rOiRWID9OlbgDMYqvnON/IOpsE 6O3eEkMKQU5ZG+Ecz/HtJLS7cKY1FSo1xMTvC6jCsidf/LhxRHr+STzsvs9gz0hbn4GC XpXzT/GIU8JAT6GuuhTmZhnhynLr0W0Gz51p9CGhFt3B455XcbCP86c56Xxmd6fdp3vx O116vFWLwc4F3g9CYAwhgyFchEeI3hgSFqx0knOqT/dnS57Tf6VX0+3zfEaQf2cvj77W 19ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AeUCwFyYTQcTT6ch132eQcfBZRX+bCc7/V0DsvmSMbU=; fh=DFrBUO7YSIh1Wp9LMAhPwV6EfzyGl7cP8i+MUkZ/afo=; b=fUoYrP4xh9LnSyI/KN1ncOFlRQhv/ooK54Dt9ZcdJqScnrxNR0Bc2x8tmsUZqUvYfM lXcmdLYEqvWqkrH3ClEB467HRqA26pLXTBuA9SCfX34XkgrHuZRWCGb3djuse2Y6uc5F c/RY/BoitSHCs94IKAY+2D6YgaisD662mQQe/mu7RcR8lRH5qkoHNArDu+Zq0UgQK4Ah 1YDPoC1ZxNJEgosRtoCP7ES4WtlnOXcf25X5GGaRiV7+iXxfCZIPZPQG67PE1NV8ugo0 M4sgiENq7CENZlg3jHeh+Z+rzB4xPiz7yGV+y0sN/1IOvhfZesqYfcEmZ5f+MSXQ793T 0lvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Jem4Xr0M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d1-20020a170903230100b001c62cfff795si8761536plh.429.2023.10.24.09.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 09:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Jem4Xr0M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 868F880934B0; Tue, 24 Oct 2023 09:06:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234605AbjJXQFy (ORCPT + 99 others); Tue, 24 Oct 2023 12:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjJXQFw (ORCPT ); Tue, 24 Oct 2023 12:05:52 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6206783; Tue, 24 Oct 2023 09:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AeUCwFyYTQcTT6ch132eQcfBZRX+bCc7/V0DsvmSMbU=; b=Jem4Xr0MuEmgPQKcRUsvQA06Ae 4KTpY1w0KQDNMUuGCJvn4vEzXXO4EA9Cd+lWQhIPj++cDEEI9o7Lel5Ig3IRsiTLPY+ogt2PpQoPO hejHQO1VropWoTxGLx7LgX888GdonKtLsn7/Z50NFa1ibB0WJxo8XMavW7seuTf40VtN3nwXqjDMc 5oIb/knNNgEy1zOuwtJGEgv183tRDP1PvW7Ol0WRNS4w9Wp5Ei4e9zVHvCZkGvRSJd3r7Z6jC4Lhg 5UFDuW04m+3yzFObpswJkyCZNtGWqJmfJ6bkd7OhCo8Gq0xxKWcfux49gmXW6jZlXQujxpl3T8sN+ J9i46lOA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55354) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qvJuY-0004cs-1H; Tue, 24 Oct 2023 17:05:42 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJuW-00062N-QM; Tue, 24 Oct 2023 17:05:40 +0100 Date: Tue, 24 Oct 2023 17:05:40 +0100 From: "Russell King (Oracle)" To: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , "Rafael J. Wysocki" , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH 38/39] cpumask: Add enabled cpumask for present CPUs that can be brought online Message-ID: References: <2023102411-ascent-plot-04fd@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023102411-ascent-plot-04fd@gregkh> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 09:06:01 -0700 (PDT) On Tue, Oct 24, 2023 at 06:02:30PM +0200, Greg Kroah-Hartman wrote: > On Tue, Oct 24, 2023 at 04:19:24PM +0100, Russell King wrote: > > From: James Morse > > > > The 'offline' file in sysfs shows all offline CPUs, including those > > that aren't present. User-space is expected to remove not-present CPUs > > from this list to learn which CPUs could be brought online. > > > > CPUs can be present but not-enabled. These CPUs can't be brought online > > until the firmware policy changes, which comes with an ACPI notification > > that will register the CPUs. > > > > With only the offline and present files, user-space is unable to > > determine which CPUs it can try to bring online. Add a new CPU mask > > that shows this based on all the registered CPUs. > > > > Signed-off-by: James Morse > > --- > > drivers/base/cpu.c | 10 ++++++++++ > > include/linux/cpumask.h | 25 +++++++++++++++++++++++++ > > kernel/cpu.c | 3 +++ > > 3 files changed, 38 insertions(+) > > > > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c > > index 2b9cb2667654..f8bf1d4c7d71 100644 > > --- a/drivers/base/cpu.c > > +++ b/drivers/base/cpu.c > > @@ -95,6 +95,7 @@ void unregister_cpu(struct cpu *cpu) > > { > > int logical_cpu = cpu->dev.id; > > > > + set_cpu_enabled(logical_cpu, false); > > unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu)); > > > > device_unregister(&cpu->dev); > > @@ -273,6 +274,13 @@ static ssize_t print_cpus_offline(struct device *dev, > > } > > static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL); > > > > +static ssize_t print_cpus_enabled(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpu_enabled_mask)); > > +} > > +static DEVICE_ATTR(enabled, 0444, print_cpus_enabled, NULL); > > This needs to be documented somewhere in Documentation/ABI/ did I miss > that patch? Thanks for pointing that out, no you missed the patch as nothing touches Documentation/ABI/ in this patch series. I'll add some blurb for it for the next iteration. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!