Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5919115rdb; Thu, 14 Dec 2023 03:38:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnXWGEutA4Z6duroKXF/2U51MM3mVqdrxx1myUJTeeB+WWKzQ22GqYB4J1Rv6260Oe8VVm X-Received: by 2002:a05:6e02:1b8d:b0:35d:60bf:7848 with SMTP id h13-20020a056e021b8d00b0035d60bf7848mr12808109ili.47.1702553899902; Thu, 14 Dec 2023 03:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702553899; cv=none; d=google.com; s=arc-20160816; b=NHFWoU9MUFFaSwmGWtv2+w75ZmD9YYVXl5swuYjna+NV8MCWeOkgS7RKMOU/lsEZ4u B6gTUU7G3Zcq8DsKSbxa4qzf4Erhht2yFavTAKGelI9xqsYEF3gIs3zxmcr1Zmj74yYY t833SKLNXdrQmIP+ejnMVGPVNuXINFDpEv44qFyJ6FaW/hxRhxDp4KF3auW25PWnTqYX 8By3OHbB978lBNCcyR4/NaTRUIujVe7HI6cLYa/R2CXJexpFzumLuYNvQ5rcAE1k6l7d l8PglNy+Stpjax1S4ba3cqg84jjL9MejGlNMjp3ZiO5HcQIIVCsH09po1VykZ34wt+OV eeGQ== 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=po5yUMYnD25KuYInj+IL1+rMXHs2i2TRzLkdJmv60bk=; fh=HBNJCb1O5m4cQgWGcwqoKY3KTbKsr5rANYvH6uVWzvA=; b=IWRjEnxyfe2jHOQAwQVhmqivDB6lW7xOw2OM2JmiwmgQR9/EPwsb8ljAOYh2dDqaOL WpT7FOMd/ui+4XgkWhEacdcNiiGXuzuvpARdPYdQDye6UjUF9UPG0c2IYiOm083T1Xms 8lyDd82RcGp6fiRzjYanH1eyQ58bkchYOc9/dRjgamQ4DdYkYMs5QsnM0E2bFPkdsiCa AM0Mi1zHvH1QZlDOuGXtsTANPPyWzl+1Z8yd9rrWedszGJPxdpVKlKgAM6O/gzr/PEM5 n5CackSN28ftUxXFPUJQO5dXbdZ0FNhVOssJYczt1BnMUm7lpHcefiUsmQdeyKf61nLX GySA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v12-20020a655c4c000000b005b18ac47c1csi10817004pgr.310.2023.12.14.03.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 414388369F70; Thu, 14 Dec 2023 03:38:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444031AbjLNLiE (ORCPT + 99 others); Thu, 14 Dec 2023 06:38:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444010AbjLNLiA (ORCPT ); Thu, 14 Dec 2023 06:38:00 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B1C3B2 for ; Thu, 14 Dec 2023 03:38:07 -0800 (PST) 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 7E79B11FB; Thu, 14 Dec 2023 03:38:52 -0800 (PST) Received: from [10.1.197.60] (eglon.cambridge.arm.com [10.1.197.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 364E33F738; Thu, 14 Dec 2023 03:38:04 -0800 (PST) Message-ID: <08664556-76c3-51d9-4202-132298cf2d7b@arm.com> Date: Thu, 14 Dec 2023 11:38:02 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v7 15/24] x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read() Content-Language: en-GB To: babu.moger@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com References: <20231025180345.28061-1-james.morse@arm.com> <20231025180345.28061-16-james.morse@arm.com> <876af164-c326-4b26-ab56-790f9a36902e@amd.com> From: James Morse In-Reply-To: <876af164-c326-4b26-ab56-790f9a36902e@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:38:17 -0800 (PST) Hi Babu, On 09/11/2023 20:47, Moger, Babu wrote: > On 10/25/23 13:03, James Morse wrote: >> Depending on the number of monitors available, Arm's MPAM may need to >> allocate a monitor prior to reading the counter value. Allocating a >> contended resource may involve sleeping. >> >> add_rmid_to_limbo() calls resctrl_arch_rmid_read() for multiple domains, >> the allocation should be valid for all domains. > > This above sentence does not look correct after your previous patch [patch > 14]. You removed resctrl_arch_rmid_read() from add_rmid_to_limbo(). Ah, this was the justification for making the allocated resource global, when the patches were in a different order. It's also simpler to make them global. I've removed this paragraph, and replaced it with: | The memory or hardware allocated is not specific to a domain. (its fairly obvious from the interface, but I felt it needed calling out in the commit message) > Otherwise looks good. > >> >> __check_limbo() and mon_event_count() each make multiple calls to >> resctrl_arch_rmid_read(), to avoid extra work on contended systems, >> the allocation should be valid for multiple invocations of >> resctrl_arch_rmid_read(). >> >> Add arch hooks for this allocation, which need calling before >> resctrl_arch_rmid_read(). The allocated monitor is passed to >> resctrl_arch_rmid_read(), then freed again afterwards. The helper >> can be called on any CPU, and can sleep. > Reviewed-by: Babu Moger Thanks! James