Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp38577pxb; Fri, 17 Sep 2021 18:04:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV4Yr8XgZr4FA/4GG5tfuaUnak/YUOV8/0i/CHHVPlcdx7mtb1TOJxjxyiH2TcYdRUPldz X-Received: by 2002:a17:907:2642:: with SMTP id ar2mr15335801ejc.175.1631927081220; Fri, 17 Sep 2021 18:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631927081; cv=none; d=google.com; s=arc-20160816; b=sZP2d/JaB6X0jKkCnfUaMt3oFCW4qQdPKhb8u7vop0e7x/ld5HJ5WyHDcSDaRvjuhz CkvLd5Cw4Q2fcbz0UnYXijKJTzxJBCyx3so05a6nkjy4SvbP8tWY+lVVTHrPHEE+l80e PnvSeD0RSyd0QrpvY75W1u6OBlNLTl0jZHd+b2Wq2EAkT0V72Rf27uMT0qZW3GDzIMdT rt/sxTcrlZLMsMa1Ni9lL/0n6Uc0BhO5YLXUslPKlOf5iFOcSlBkQVg0bJXKOmFrhyad +CGaX6/9z9DsG5y8PGCjPWPMgzNCwANgFew/GqMkO7XInCkPCJbUBzp9NGWPRTGJeYpG 4tLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=JWu667IA4dNLe+hCRYFFzWVOGKlonpvuqFqXnMdwFIE=; b=yRFyYC4oHvWMoZzo9QQErPqloRfS/MhgzjP7kuN6ZnnHGKNSqtnJXBGxL/8Dweyk5i fmYgfCdBXz/M1rOcL71RmniNE2fuJ26VD2fvTNA9M6V4ntwA+0pvdhFEFtNf9ooJFdg2 uv44LjlBLWCS+qcAMj1cbtCCEwtitzk9kPe8Y175EtQbz9dEG/pH1/p5xl7kEbefZvPj g87xR7cSYH3Oyl1/xunTwjHy5ASXQG5U0+5jD+QdWWuu5NF36UPW5fNwNWvspi1NX3bx MLBmVAY0pTYmhJ3IOBgvDAvECXzDMrg73XmsAI6w2fGJeHXmaiW3yl0jgbkMQp8hmLuu N24g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si9087287ejm.150.2021.09.17.18.04.17; Fri, 17 Sep 2021 18:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S244998AbhIQQ72 (ORCPT + 99 others); Fri, 17 Sep 2021 12:59:28 -0400 Received: from foss.arm.com ([217.140.110.172]:55516 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244962AbhIQQ7P (ORCPT ); Fri, 17 Sep 2021 12:59:15 -0400 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 48391101E; Fri, 17 Sep 2021 09:57:53 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E356C3F59C; Fri, 17 Sep 2021 09:57:50 -0700 (PDT) From: James Morse Subject: Re: [PATCH v1 09/20] x86/resctrl: Abstract and use supports_mba_mbps() To: 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, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com, bobo.shaobowang@huawei.com References: <20210729223610.29373-1-james.morse@arm.com> <20210729223610.29373-10-james.morse@arm.com> Message-ID: <68dc7be2-9d07-15ca-1c53-d74e17e83ba6@arm.com> Date: Fri, 17 Sep 2021 17:57:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 01/09/2021 22:27, Reinette Chatre wrote: > On 7/29/2021 3:35 PM, James Morse wrote: >> To determine whether the mba_mbps option to resctrl should be supported, > > mba_mbps -> mba_MBps > >> resctrl tests the boot cpus' x86_vendor. > > CPU > >> >> This isn't portable, and needs abstracting behind a helper so this check >> can be part of the filesystem code that moves to /fs/. >> Re-use the tests set_mba_sc() does to determine if the mba_sc is supported >> on this system. An 'alloc_capable' test is added so that this property >> isn't implied by 'linear'. > Why can linear not imply alloc_capable? It is a property of a MBA resource so if it is set > then it has to be a MBA resource. mba_sc depends on controls and monitors. It checks for monitors with is_mbm_enabled(), and assumes that the delay_linear property being true means the control feature must exist. I think this is fragile. For MPAM, delay_linear is always true. Any way of controlling the bandwidth has this property. Its very likely to be set statically in the struct, regardless of whether the controls exist. alloc_capable seems to mean 'controls exist'. This is to avoid an annoying bug where supports_mba_mbps() reports true, but the controls aren't available. Or equally annoying, for the arch code to set/clear that flag in addition to alloc_capable. I'll add some verbage about MPAM to the commit message. Thanks, James