Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp903938rwn; Thu, 8 Sep 2022 10:18:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5OFlOIGN9UWNL98xBdUpj112JrYYyLKnRc6FehO9w132MjWQ5TdW54KXCjvDqKt3j5m+Jz X-Received: by 2002:a05:6512:3a96:b0:494:71e2:6d86 with SMTP id q22-20020a0565123a9600b0049471e26d86mr3331433lfu.274.1662657502948; Thu, 08 Sep 2022 10:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662657502; cv=none; d=google.com; s=arc-20160816; b=d4qDQFjKSjxo51zltlps/iR35MVNlbwsHZxeBmHjGDUEDN2T3sg1fFdEQihXmIfueo 19BrRyjFMCi98rAd1De9UOm4lyUKHPkw03PXo6jUlegIamATtePgCfjog+NmlvTdiDc1 T7x6dCgn9ymgsj1QqOjcHtr0OksPrBFPRmOANqnBpex1lNvFAXKIyKxkGriQlddajv24 6vyN90/XCIxleua9VV0HaEsDSY8AIJ/DojNJewhRU27B7xzfE04XHUxTpVbrwlrYF/0/ XkyFnFaeuZHr+jcMfr6SSLiuaFHAycBxvQAEgxBsGOG3LlRxngb8i9s6TTRbcG8cL0+M pjaQ== 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=QRFB4ew2lNJrAr8TM8TUg+X6LKju6wOQ7ODTWfsbUIk=; b=Qriggy1IPAWIBaEznY+vsQUEgZ0GqfEqE5LtVfN/+XW47eQxvIox7G262TM7QfvoYQ zrsT5OsIy0i7/1bMXMXmd9h48pdev6Z2+yYAboHBunVapATmFSzrPy/ZHtPUsYupHqsO VDVftgD5zYby1UGRF5WETBezStLcUIdq/70h7fFeOMRu2q2XdJ79sR6trJmZ3hMovixc 7b7fHnE9WH+xQrBqPSR+xJPzUSNY1pp5D8cIjJvu6BoX6gHIhqdPZp4Z96/eQJf/3Ee6 4gu966aiNy9oEnSdPVz/8+KfNgkBEfCVFBNXiYwoXrpCIlOK8meEnOrY7ypzAQtQ5yXl iAyA== 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 f12-20020ac24e4c000000b0048b2d8e0681si8420212lfr.173.2022.09.08.10.17.53; Thu, 08 Sep 2022 10:18:22 -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 S230450AbiIHRBg (ORCPT + 99 others); Thu, 8 Sep 2022 13:01:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230497AbiIHRB3 (ORCPT ); Thu, 8 Sep 2022 13:01:29 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 79BB6EA423 for ; Thu, 8 Sep 2022 10:01:28 -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 89FE0153B; Thu, 8 Sep 2022 10:01:34 -0700 (PDT) Received: from [10.1.197.78] (eglon.cambridge.arm.com [10.1.197.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D3A593F71A; Thu, 8 Sep 2022 10:01:25 -0700 (PDT) Message-ID: <0586ab4b-e201-fbeb-927d-8ba709573b07@arm.com> Date: Thu, 8 Sep 2022 18:01:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v5 00/21] x86/resctrl: Make resctrl_arch_rmid_read() return values in bytes Content-Language: en-GB To: haoxin , Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, Jamie Iles , Cristian Marussi , xingxin.hx@openanolis.org, baolin.wang@linux.alibaba.com References: <20220622164629.20795-1-james.morse@arm.com> <5adf4968-b079-2fd3-dd61-09ed16f74080@intel.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 Hao Xin, On 07/09/2022 06:46, haoxin wrote: > 在 2022/8/24 上午1:09, Reinette Chatre 写道: >> On 7/3/2022 8:54 AM, Xin Hao wrote: >>> [root@iZbp1bu26qv0j3ddyusot3Z p1]# cat mon_data/mon_L3_00/llc_occupancy >>> 3833856 >>> [root@iZbp1bu26qv0j3ddyusot3Z p1]# cat mon_data/mon_L3_00/llc_occupancy >>> 3620864 >>> [root@iZbp1bu26qv0j3ddyusot3Z p1]# cat mon_data/mon_L3_00/llc_occupancy >>> 3727360 >>> [root@iZbp1bu26qv0j3ddyusot3Z p1]# cat size >>>      MB:0=100;1=100 >>>      L3:0=3407872;1=3407872 >>> >>> Obviously, the value has been overflowed,  Can you explain why? >> I do not think the conclusion should immediately be that there is an >> overflow issue. Have you perhaps run into the scenario "Notes on >> cache occupancy monitoring and control" described in >> Documentation/x86/resctrl.rst? >> >> When "memhog" starts it can allocate to the entire L3 for a while >> before it is moved to the constrained resource group. It's cache >> lines are not evicted as part of this move so it is not unusual for >> it to have more lines in L3 than it is allowed to allocate into. > > Yes as you said, the mon_data/mon_L3_00/llc_occupancy does not immediately become the > value small than the set by schemata,  it may takes a few minutes to reduce to the set value. > > I don't quite understand why it takes so long to see the llc_occupancy degrage. Do you have workloads in other control groups causing cache allocations? One of the ways this stuff can be built is for the cache to use the policy to choose which lines to evict. The cache may already have some LRU or line-state preferences when it comes to eviction, so it may not apply the RDT policy as the first choice. If there is no cache pressure from outside the control group - does it matter how quickly it takes to apply? Thanks, James