Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp183403rda; Sat, 21 Oct 2023 03:57:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAQzA8opgZH2QEplkMBF5qGUhegmX8SQQMhY9vVitC/JP5ptjUOmM0weiCfJYmfhTKCgEq X-Received: by 2002:a05:6808:1b0f:b0:3ab:8956:ad95 with SMTP id bx15-20020a0568081b0f00b003ab8956ad95mr5445460oib.9.1697885861826; Sat, 21 Oct 2023 03:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697885861; cv=none; d=google.com; s=arc-20160816; b=s4t4eTBLKMYO3waZ35bWXbUMp+VoG5zG9C2U2yo6WvUKvydTvLgkacyWHzKeowh1NU SBL904jUNSQFdw9ofoIvin/Vy/SNaUFofzDANXfYf6KC0+smbURmk8FKWv79xh4d2YZE pGe5T9Rw5DXNwd+4oLi4QDZaOQONtvAiU85TgpjtsFdZr/oWPU6/RMyloKVXehLJ2z3M mmqjR3AtrJo37T0xynjjAOLUBd6DX5W7o5V4f5bQqrf1V9FG/IuRnk+vi3damlrYtrCW 0qe8qhELkcRl6716FRToDNPUxiPDI6uvMcITm62X9WVYN3WaNsm/xe0I4dgdnG88RAuz yHUw== 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=y4fczcGz4R9j4c1CC5q4Sn2YTe16DiWhIyjL4mbqQ+8=; fh=neey927Rm+L90HGovg/U2cU0UELNiEFQX2UwJKYjFwE=; b=mORqwxJyDdrZb5tnLvb/LF6mOnnS4i2HK7KqqSIo+8ZqJBD6JNbqhjaqPppQtiM4vr WNq9+cs5/45zULNieohjRze4neuxU68ZY2EbZOMqgEaz30JeZ2yAxbBFN6/aLyj781uW K0kDuARWlRbHzuwBDfPYNVWQvNEi5n9VTOf4tC1MyZELBJEg/77bTvS8exoB30N0cg6I cSD/O50CfnSjiP11M1SnEt/P3gWjwKvsprzjHCyATkzUgtATsVgJrX0DNSUPcPm8goMu MEu7paaq9KgSC8z3Z4fzEavG4jOdmhkDGP1FZQScMKsKAkPqz+2z07F843UOx8Ecz6Ow PwSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hTcaPIRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c23-20020a170902b69700b001bb95a5cb9fsi3237220pls.522.2023.10.21.03.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 03:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hTcaPIRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4B304804C64E; Sat, 21 Oct 2023 03:57:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbjJUK5E (ORCPT + 99 others); Sat, 21 Oct 2023 06:57:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230309AbjJUK5D (ORCPT ); Sat, 21 Oct 2023 06:57:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BEA6D5E; Sat, 21 Oct 2023 03:56:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85359C433C8; Sat, 21 Oct 2023 10:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697885818; bh=lWjx0bstoWSn8O+1+vq3s6PJ4JDA6SyKY8ViX2L7YW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hTcaPIRtnQmlyxhrbVQzTkIF6yu1dZwfQH0HKzzZf+IdjhhVDBzohjKljAvRxu6ZC +EK0hYdtjcSMWn6+4ncGofksLqwZ6P5+pfIq4uHxdEPiU2xTLxyhLfke0SYjlmgd4x HJxhZl7xo4cAk+d9+HLkSGCqfb+thCkty+PvIYNY= Date: Sat, 21 Oct 2023 12:56:55 +0200 From: Greg KH To: "Russell King (Oracle)" Cc: Jonathan Cameron , 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: <2023102128-banter-circular-85a2@gregkh> 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: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 21 Oct 2023 03:57:39 -0700 (PDT) On Fri, Oct 20, 2023 at 12:53:29PM +0100, Russell King (Oracle) wrote: > 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. Sorry, I don't see what I am supposed to comment on, so please just send a new series and I'll look at that. thanks, greg k-h