Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp960779rdb; Fri, 20 Oct 2023 04:53:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHQ9KZY1VDDrAwIjo2QdR/6t3Nu/bgcl5s0UbWGbf1AyEqS2P6Ccfu/GLA9iEmhFhxVrv+ X-Received: by 2002:a17:903:41c9:b0:1ca:a07b:361 with SMTP id u9-20020a17090341c900b001caa07b0361mr1548058ple.19.1697802834810; Fri, 20 Oct 2023 04:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697802834; cv=none; d=google.com; s=arc-20160816; b=azBhpo3y6UY4PXoxXDqrZiAmFuaKmgPGC7lj026jBnPfPZ/KB4tgbxonb97EhEGinY vUiI63oGC6bPA2316bryzTS3bjwUgX0Hy3CzODMpaa6iaLdqia/wPgLJVd4YJpdMDH/7 Fk7GqBx4tu37JLqo7L1WG9HN/PcPhQfvrYUZhAykjh+PA6y8yr8543fVRI+RlC4Txuqn kGOEX/NbRqfeivIMHRYH0vibTX1tNjTGt7/NYKEruq+xs5AJlTlOO1G84Ujpjhv/hi3a SOBm7bdxaS5RNedAJBj+LbMm+DPAp8DiguCtjCPx7nbBkI2n5ZKmC99WgfHfdpLyDGsi uaQQ== 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=ZnH9rsDzGO6weBMybmlTOxejgjbXoW+kfLP/Bw4OXUE=; fh=zQKWic8s7YwvyB1L+WDbZJyypQMGHb9PrnuOd7kR6vw=; b=E2zW3mBwZ/y3GiLBJFLuqYJD+drYZY9Ed/QjXp+u//wKVU9blL6ffHY1bf1Z4Crg9Z fHK9E27Ijodj8TeA0+3O8OyFNjNfwaIPxQuluByL366j8QCMVNqHJd1lGx3fPZFUUOUa Oh+YA6XtwWtGkF0xdrvol8vWcbchUv7U6HcVFqzTiGZcSd/Zsip5l59fdXzL8WHSCjrR LkAqmFZcBHQCl42C/k82XdA/F6uHnwBmj7F0Wv3CyXauCskreP8t8r0ulM1/y3AUr+Hj 9nks11IJ//z3t/6/tMr4kAX4Bgk8Zisp72dfeSejjK+r3QIb1as6sh/ws19YyKcmSZYd JkWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=PHFGq+CD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 5-20020a170902e9c500b001b9c992945fsi1538379plk.555.2023.10.20.04.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=PHFGq+CD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 4569683037F1; Fri, 20 Oct 2023 04:53:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377249AbjJTLxm (ORCPT + 99 others); Fri, 20 Oct 2023 07:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377257AbjJTLxl (ORCPT ); Fri, 20 Oct 2023 07:53:41 -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 D9AA0D41; Fri, 20 Oct 2023 04:53:38 -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=ZnH9rsDzGO6weBMybmlTOxejgjbXoW+kfLP/Bw4OXUE=; b=PHFGq+CDzvcu05j4/9OwcnhS+3 dniZKELXdzZ7oE3K2oURHH1f7vOrijKdYXMxblKLxLQmksJTA+Mt1qwTWLN0NwzyHRluOQ8lEZtAu HO4GZ8rV19IGOzem3PNfDR9XeB4gH23tXyd21o7vRK9lx96fXGBSWBAanRKe1HlchPKpVvCy6pKZf ca456Hj718geltF8hQwoAYhOiW6BppDwcbxBVUtresfOLi2DSCWYrWw4884RjpK6mccRd8M3wL1IT VVeCBJYEoy1nrzTjZPmVe77zFRN6Luib8s+HX9uw2MImjvcrudZ2J7RK6bffVuxYVtslyuJqU7Adp XMNN3wlA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48178) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qto4K-0000LD-0H; Fri, 20 Oct 2023 12:53:32 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qto4H-0001Vh-On; Fri, 20 Oct 2023 12:53:29 +0100 Date: Fri, 20 Oct 2023 12:53:29 +0100 From: "Russell King (Oracle)" To: Jonathan Cameron , gregkh@linuxfoundation.org Cc: James Morse , 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, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com Subject: Re: [RFC PATCH v2 11/35] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs Message-ID: References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-12-james.morse@arm.com> <20230914130126.000069db@Huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230914130126.000069db@Huawei.com> 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:53:52 -0700 (PDT) On Thu, Sep 14, 2023 at 01:01:26PM +0100, Jonathan Cameron wrote: > On Wed, 13 Sep 2023 16:37:59 +0000 > James Morse wrote: > > > register_cpu_capacity_sysctl() adds a property to sysfs that describes > > the CPUs capacity. This is done from a subsys_initcall() that assumes > > all possible CPUs are registered. > > > > With CPU hotplug, possible CPUs aren't registered until they become > > present, (or for arm64 enabled). This leads to messages during boot: > > | register_cpu_capacity_sysctl: too early to get CPU1 device! > > and once these CPUs are added to the system, the file is missing. > > > > Move this to a cpuhp callback, so that the file is created once > > CPUs are brought online. This covers CPUs that are added late by > > mechanisms like hotplug. > > One observable difference is the file is now missing for offline CPUs. > > > > Signed-off-by: James Morse > > --- > > If the offline CPUs thing is a problem for the tools that consume > > this value, we'd need to move cpu_capacity to be part of cpu.c's > > common_cpu_attr_groups. > > I think we should do that anyway and then use an is_visible() if we want to > change whether it is visible in offline cpus. > > Dynamic sysfs file creation is horrible - particularly when done > from an totally different file from where the rest of the attributes > are registered. I'm curious what the history behind that is. > > Whilst here, why is there a common_cpu_attr_groups which is > identical to the hotpluggable_cpu_attr_groups in base/cpu.c? > > > +CC GregKH > Given changes in drivers/base/ It would be good to have a comment on this from Greg before I post an updated series of James' patches with most of the comments addressed, possibly later today. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!