Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp34849ybh; Mon, 9 Mar 2020 15:34:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv5gwaENoz/etLFTqLH8OErJ6bhALGBZn+NeFMqBqhnLqRxO66hAa5rhWI+R0PKi1+PcDao X-Received: by 2002:aca:1a05:: with SMTP id a5mr1049597oia.113.1583793289090; Mon, 09 Mar 2020 15:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583793289; cv=none; d=google.com; s=arc-20160816; b=DG8EaX3QVniyaUS1DvppDQgBkVVgMuGaYnD7QJE3Y9CVRwqlgT6rq27Ks7kjzdGqaq 1iTsdAE57i7bmPa8DHWDZRw+FNVT4WXAgLdjZwQqCJgp6d0cX3ecgxD/VVNPOEJ2v08q K2DfseZD0T+3YXnBDpCpzzDXA+Hdk+n6BN65WE2cbv8itXDQlYVmc/utPlKPfKVR6UxG 7S0+9S5hjeKdExJivbQ2lz84vT77igEA5zmh26FgWHlrHDFkReMPzxWyScZfO3hvX8Mb cL5Jjt2xavR7DfMXGwritfrnZbwSbjLrL65CUaAwLLgWGXlxGdglnon9ekwzx8x1SeB4 sZSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=vuKx4slkE4klIb3kAAoBUIY7I7cyBaa1Ab/8sJFQpYI=; b=TeFORJRnj/JDY0NJsCbhRdfBGw8JS/dXLqeds3/pwdeZ7vPRrQk3iA5xQzZlAxWuZi +2g2Xm3rYlcoQ4xH/uGqYm3mB+AaXoPKGw9+6n1sTD77+w13vHbFPox1FdJk3IDauVtB tGmmA4KNS8erBOnIvTmJTsfc4i53tZwt9zz2hzG1cujvF6gmn9zae/Q+PagVhrn0G65O NDSMZ3EEGagNSN7PY6WcvINPplX3a/+Qg1P/eVfekhPCrJbFlaTOSFUPsfK03uKt/YmZ x/U1orWc5OWqmmHc9mZwXgAfHUgFOTRu9cIGOe8TmXE8u7r2kKz3AzhAOyjhz/RZnnhg TVRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si6708128oti.124.2020.03.09.15.34.36; Mon, 09 Mar 2020 15:34:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727391AbgCIWeA (ORCPT + 99 others); Mon, 9 Mar 2020 18:34:00 -0400 Received: from mga18.intel.com ([134.134.136.126]:49129 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727143AbgCIWeA (ORCPT ); Mon, 9 Mar 2020 18:34:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 15:33:59 -0700 X-IronPort-AV: E=Sophos;i="5.70,534,1574150400"; d="scan'208";a="245491074" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.251.21.24]) ([10.251.21.24]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Mar 2020 15:33:58 -0700 Subject: Re: [PATCH V1 01/13] selftests/resctrl: Fix feature detection To: "Prakhya, Sai Praneeth" , "shuah@kernel.org" , "linux-kselftest@vger.kernel.org" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "Luck, Tony" , "babu.moger@amd.com" , "james.morse@arm.com" , "Shankar, Ravi V" , "Yu, Fenghua" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: <7e3e4b91f5786a489e68eecda21e1d8049b60181.1583657204.git.sai.praneeth.prakhya@intel.com> From: Reinette Chatre Message-ID: Date: Mon, 9 Mar 2020 15:33:57 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sai, On 3/9/2020 3:22 PM, Prakhya, Sai Praneeth wrote: > Hi Reinette, > >> -----Original Message----- >> From: Reinette Chatre >> Sent: Monday, March 9, 2020 2:45 PM >> On 3/6/2020 7:40 PM, Sai Praneeth Prakhya wrote: [SNIP] >> Please note that this is only a partial fix. The current feature detection relies on >> the feature flags found in /proc/cpuinfo. Quirks and kernel boot parameters are >> not taken into account. This fix only addresses the parsing of feature flags. If a >> feature has been disabled via kernel boot parameter or quirk then the resctrl >> tests would still attempt to run the test for it. > > That's a good point and makes sense to me. I think we could fix it in two ways > 1. grep for strings in dmesg but that will still leave ambiguity in deciding b/w mbm and cqm because kernel prints "resctrl: L3 monitoring detected" for both the features > 2. Check in "info" directory > a. For cat_l3, we could search for info/L3 > b. For mba, we could search for info/MB > c. For cqm and mbm, we could search for specified string in info/L3_MON/mon_features > > I think option 2 might be better because it can handle all cases, please let me know what you think. I agree. For the reasons you mention and also that (1) may not be possible if the loglevel prevents those lines from being printed. Reinette