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 5B18BC77B6E for ; Thu, 13 Apr 2023 15:06:11 +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:In-Reply-To:MIME-Version:References: 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=xP7tosgXI4+vmwfbV15bJv0+m1pXP3fSdoOCxjVUF9o=; b=2IJ7Mk7FfXJNKx 6mSMs5G/dzXoJkn32fufk+gM+Itnlz18nJ9CemOBe/WxFcN0Wdo1BBp+MlPLi0+9M+NmqeccbV3YO yVqrak0tTwUtJoPSSyDeE8HV8grWF7X01edKmt1eEH8vSUGOrQByC8bQlJJOW0LVEDlzqDrXUkSAw HDrAbteDObUeGazp3eqmOoin3WGkNci5ejCjZ/fIGudl2l9Q61VY2Ua/s4dwsQJk5yah6iDx+TUHC 7fDCT41AP8EfBTqaZopRKPQ/jVg8nfMGvj3mQmXVX0gOU4YXt8w15fsOju6y5NPqtXyk3O2Iy9ARp A/3B4b7e9gWdvuLP/G8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmyVg-006TkH-0B; Thu, 13 Apr 2023 15:05:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmyVb-006Tjj-1u for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 15:05:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 562BE11FB; Thu, 13 Apr 2023 08:05:53 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D91603F73F; Thu, 13 Apr 2023 08:05:07 -0700 (PDT) Date: Thu, 13 Apr 2023 16:05:05 +0100 From: Sudeep Holla To: Will Deacon Cc: Radu Rendec , linux-kernel@vger.kernel.org, Catalin Marinas , Pierre Gondois , Sudeep Holla , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 2/3] cacheinfo: Add arm64 early level initializer implementation Message-ID: <20230413150505.75g2dp6ra2ytfvpu@bogus> References: <20230412185759.755408-1-rrendec@redhat.com> <20230412185759.755408-3-rrendec@redhat.com> <20230413102226.yzzd6iccqeamheas@bogus> <20230413144519.GA26421@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230413144519.GA26421@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_080511_730473_CC47D799 X-CRM114-Status: GOOD ( 33.43 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 13, 2023 at 03:45:22PM +0100, Will Deacon wrote: > On Thu, Apr 13, 2023 at 11:22:26AM +0100, Sudeep Holla wrote: > > Hi Will, > > > > On Wed, Apr 12, 2023 at 02:57:58PM -0400, Radu Rendec wrote: > > > This patch adds an architecture specific early cache level detection > > > handler for arm64. This is basically the CLIDR_EL1 based detection that > > > was previously done (only) in init_cache_level(). > > > > > > This is part of a patch series that attempts to further the work in > > > commit 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU"). > > > Previously, in the absence of any DT/ACPI cache info, architecture > > > specific cache detection and info allocation for secondary CPUs would > > > happen in non-preemptible context during early CPU initialization and > > > trigger a "BUG: sleeping function called from invalid context" splat on > > > an RT kernel. > > > > > > This patch does not solve the problem completely for RT kernels. It > > > relies on the assumption that on most systems, the CPUs are symmetrical > > > and therefore have the same number of cache leaves. The cacheinfo memory > > > is allocated early (on the primary CPU), relying on the new handler. If > > > later (when CLIDR_EL1 based detection runs again on the secondary CPU) > > > the initial assumption proves to be wrong and the CPU has in fact more > > > leaves, the cacheinfo memory is reallocated, and that still triggers a > > > splat on an RT kernel. > > > > > > In other words, asymmetrical CPU systems *must* still provide cacheinfo > > > data in DT/ACPI to avoid the splat on RT kernels (unless secondary CPUs > > > happen to have less leaves than the primary CPU). But symmetrical CPU > > > systems (the majority) can now get away without the additional DT/ACPI > > > data and rely on CLIDR_EL1 based detection. > > > > > > > If you are okay with the change, can I have your Acked-by, so that I can > > route this via Greg's tree ? > > I really dislike the profileration of __weak functions in this file, You mean in the generic cacheinfo.c right ? Coz arm64 version must not have any and that is the file in this patch. > rather than the usual approach of having arch-specific static inlines in > a header file but it seems that nobody has the appetite to clean that up :( > Yes, I will try that when I get sometime. I had not seen or touched this for longtime until recently when new requirements around this are coming. > So I'm fine for Greg to queue this if he wants to, but I'd be a lot more > excited if somebody tidied things up a bit first. > Agreed. One reason for such weak functions was to avoid conditional compilation based on arch at that time with the aim to include couple of more archs but that hasn't happened and perhaps it is time that it needs a refresh. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel