From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72A12C4167B for ; Tue, 28 Nov 2023 14:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CHzn8VAJtK1P2rYV9vGG4fMtU3bT/TV8Z1sn2o1RNI8=; b=hNrpRkhalk9fY7 ltSZs/yF5D2B7CkDak4I6eo8EUf5/JvOdrS3k+zjI7zmQRGGZNSIYsiPATg77J9MXufmgzO1hTe8m M/jg0Ig0/O1pmhznm878sl9CN09GWTNRUDmDFLVtloZUtuzaOgSF8o5tldZiek3I82XiOI0ieMy5i DC4jHI4zNyPf+r7XRBUi8ZKYsbRbCPJFytBNaMwtVcZXt2GR8nndMvRoXt4lt6bqYxt847hxxd50/ 3PCj0h/ZB01lk87Ba+zbuszvrF2qYzHkHAZRCWWW2rYGDPOpdYBY1QH5jMuzn1OPgR6HzuTafGp8x hU7YG8dS9gqaotrAUw5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7zDU-005WSR-0L; Tue, 28 Nov 2023 14:37:36 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7zDQ-005WQL-2V; Tue, 28 Nov 2023 14:37:34 +0000 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SflPL4T8Rz688jJ; Tue, 28 Nov 2023 22:35:50 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 39FB114025A; Tue, 28 Nov 2023 22:37:24 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 28 Nov 2023 14:37:23 +0000 Date: Tue, 28 Nov 2023 14:37:22 +0000 From: Jonathan Cameron To: Russell King CC: , , , , , , , , , , , , , Salil Mehta , Jean-Philippe Brucker , , , James Morse , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH RFC 01/22] arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs Message-ID: <20231128143722.000032db@Huawei.com> In-Reply-To: References: Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231128_063732_956372_B8912FD4 X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, 07 Nov 2023 10:29:23 +0000 Russell King wrote: > From: James Morse > > 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'm not keen on squirting sysfs files in from code so might be nice to do that anyway and use is_visible() / sysfs_update_group() but that would be a job for another day if at all. Reviewed-by: Jonathan Cameron _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv