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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01BE3EB64DC for ; Mon, 17 Jul 2023 17:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbjGQRGr (ORCPT ); Mon, 17 Jul 2023 13:06:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229940AbjGQRGn (ORCPT ); Mon, 17 Jul 2023 13:06:43 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D6B510E for ; Mon, 17 Jul 2023 10:06:39 -0700 (PDT) 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 57838C15; Mon, 17 Jul 2023 10:07:22 -0700 (PDT) Received: from [10.57.79.8] (unknown [10.57.79.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E67CA3F738; Mon, 17 Jul 2023 10:06:34 -0700 (PDT) Message-ID: <24ebc625-bcb9-53ab-6c57-76cdad53745b@arm.com> Date: Mon, 17 Jul 2023 18:06:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v4 12/24] x86/resctrl: Make resctrl_arch_rmid_read() retry when it is interrupted Content-Language: en-US To: Peter Newman Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, xingxin.hx@openanolis.org, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , dfustini@baylibre.com References: <20230525180209.19497-1-james.morse@arm.com> <20230525180209.19497-13-james.morse@arm.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 6/8/23 09:53, Peter Newman wrote: > On Thu, May 25, 2023 at 8:03 PM James Morse wrote: >> >> resctrl_arch_rmid_read() could be called by resctrl in process context, >> and then called by the PMU driver from irq context on the same CPU. > > Will there be x86 PMU changes to do this or is this only ARM? I just > want to make sure the x86 resctrl_arch_rmid_read() changes are > actually needed. I plan to add that as an uncore 'resctrl_pmu' that works for all architectures by calling resctrl_arch_rmid_read(). Having that be specific to arm64 isn't helpful to user-space. Perf is the natural home for these counters, and it will make it easier to add per-architecture (or per-soc) counters, without having to teach resctrl about them. This patch moved to be 'this' side of the 'move to /fs/resctrl' because this can happen without the PMU changes. If a NOHZ_FULL CPU makes a syscall to read a counter, that happens in process context, if a CPU in another domain wants to read the same counter, it has to send an IPI which might target the same CPU. (I've not investigated whether this is an existing bug) Thanks, James