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 40ABAC6FA82 for ; Thu, 22 Sep 2022 13:28:47 +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=IXIMbPXyynlP8T8uCrPS6MUHuCOTgpCkfs2Tcx4lGkw=; b=1o5dBt+jHTQK0T eIyOgVqOd5EqNADdllmbz7beRUiSB0qGjXAX4p/9BGAVsSTApEktPtJ38PkQmmM4AklD3RKEsxX4Y 8Wv2EazI23z9SuNjrTbn+9jMQR+Xq1eX5Y9dY8cNdbloKAlA0tFqvsVi2C9F9ROtBLurknOFo5t9n F0mE8VYLbpnklSWVhjm/0urql2iys7EMwU+VgD5DPvxsOh5Y9IpqYBgYwN/OoafmW11VeioSSA4bH bmYB7QZ6fe6+Xuv1LCSccBshyS6F/EF/+GemglfoBUSUnc78iqMuh9QSC9CioJgiN+Gbxvf7jmcmn i0USsckQViuHeRvKYNWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMF8-00FfaS-Nw; Thu, 22 Sep 2022 13:27:54 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMF5-00FfXj-Dq for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 13:27:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC891B83021; Thu, 22 Sep 2022 13:27:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4932C433C1; Thu, 22 Sep 2022 13:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663853266; bh=DY9TxgTImIQyAvfjUKkwmtdipv1ptGHWjBTLeLlMbB4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SsfGjl89b10o7QazXb/UMOXL152YEI1ALY2l/UwlpEFd+vQ22bUvM774RApxPUdSx Ep3x/n9+MkdNWw75RyB19eMtuJkjszXKdMjZYIuf26qazJFfFM9ftJs+KoTs395LKT tHZE9hcr3F7NcIs6FeutZO2M5VfDq+4+t5kmolxwSfvL7fIEv2KnF/gljm/4BCl339 K0tD+jbNgCdru1fEvRbecQV+4YNvQcobaC8LmegR47PMSeVKEWcRtSOL6Hpro7PQDn j7YL2R+WqrE+QDqTT0MFD94hTZy4plbINXWwCECJ6ZKeywkc5D8hBidZHvIJ0m52t2 9Gi51w1+0uY2Q== Date: Thu, 22 Sep 2022 14:27:41 +0100 From: Will Deacon To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Dietmar Eggemann , Valentin Schneider , Thomas Gleixner , Sebastian Andrzej Siewior , Mark Rutland , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 0/1] arm_pmu: acpi: Pre-allocate pmu structures Message-ID: <20220922132740.GB12095@willie-the-truck> References: <20220912155105.1443303-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220912155105.1443303-1-pierre.gondois@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_062751_629310_493E5292 X-CRM114-Status: GOOD ( 19.12 ) 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 Mon, Sep 12, 2022 at 05:51:03PM +0200, Pierre Gondois wrote: > Sleeping inside arm_pmu_acpi_cpu_starting() while running a preemp_rt > kernel was reported at [1], and a solution was suggested at [2]. > > It seems [2] doesn't work because of the following: > """PREPARE: The callbacks are invoked on a control CPU before the > hotplugged CPU is started up or after the hotplugged CPU has died.""" > > Indeed the 'prepare' callbacks are executed on the control CPU and > this CPU cannot remotely read the cpuid (cf read_cpuid_id()) of the > other CPUs. > > Another solution: > 1. count the number of different PMU IRQs (#IRQs) > 2. allocate #IRQs pmu structures. There is at most #IRQs PMUs > 3. in arm_pmu_acpi_cpu_starting() subcalls, after checking the cpuid, > decide to use or re-use a pre-allocated pmu structure. > Thus the pre-allocated pmu struct can be seen as a pool and all > the struct might not be used. > 4. free the unused pmu structures when probing > is suggested in this patch. > > Freeing the unused pmu structures (4.) could maybe be done in a > CPUHP_AP_ONLINE_DYN hotplug callback instead, but only one CPU is > needed to search/free unused pre-allocated pmu structures. I vaguely remember Mark R having a look at this at the time, so I'd like his Ack on your approach before I queue anything. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel