Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5855326rwp; Mon, 17 Jul 2023 10:25:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlGehRHaQGWicgH8Dgr0Kumv9WLnxTQcioXd0jB86Zt+yyDP86mofTtWgAqVgdcSRoqIYif6 X-Received: by 2002:a17:90b:3449:b0:263:f630:228f with SMTP id lj9-20020a17090b344900b00263f630228fmr12425130pjb.23.1689614710426; Mon, 17 Jul 2023 10:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689614710; cv=none; d=google.com; s=arc-20160816; b=vVzk1VNqRKIVpqICLSrGOpqLE2TPz3slzVDr/OivOvOwW4p12TkR7mmyrWiWgdegk/ t9XPNaFWhtcoxYEthBLvD9tnrcOhXpOKg3BWpISKwBnAchOibvv9P96jJ41O04hkwMKp wdczEjjke6nAFA+MVYLioh+6c+rHnCcy75sEJHdypHAnE4eve4oAMZXeojieOq9QO2KO 1lKM0anf1/eJhWrXjQq5EGkn4NClNKNW/pvI+aMYmV7QBgT2KO5YEiU+EeKYeJ+LmRcT oyXAY7Uyuu8XoQUCq+B5q+IMaX3T3abb5AE1TRe4V0Zm5OIDkXi5y42QFEH3w5CpxbwM KL/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=CquGQrNCtDu/te0nCSSls0jzJZnAo5sgdpjcCRwuK8A=; fh=fvhjIpPy9mUZO++1M4nSZvKV9LqxnhH4nfskhlXpySo=; b=xrqy19c5DPFHQR36GQJ51m9YQspAeUOHUMBW2CFpLohQ0Qf0c+0sAv1L3tmPZ2nJar 5ZfFMVG4HONFwrahPAwGbiLzwfVHgTkPoG+tVWiWWqck3MlQ14O0YM2NS6l1TlKxhGrD Ec311DkJ8gqgh3DqpSqHVSrG65JQ2bdFE6Ji8uBGoDcD2MPXCNZ5xiX6ZzCuQGTS+p4s LpytM8GqtUMeMFyVWKiauCDXTxg4lTAb2CTf2jrMB/A/cC5Vsmf3jOzvZxAt2yZJ14sr cM/89Agyx5TK2Sy/AAb8MaTYkvUXB9si53DVc8vgDjnG9Vbxf9iI2j5nR6qA9yWJ8UWz reVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh17-20020a17090b4ad100b002677027a8c5si152101pjb.52.2023.07.17.10.24.55; Mon, 17 Jul 2023 10:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229379AbjGQRGq (ORCPT + 99 others); Mon, 17 Jul 2023 13:06:46 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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