Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1161597rdh; Fri, 27 Oct 2023 06:32:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/tAE3gZXrBaebhhxN8CysX2FMceofhDQZZrPDpvq4bJK+evVTGK5WK0cx9m4ZArj0fNgv X-Received: by 2002:a05:6214:27cb:b0:66d:f94:522d with SMTP id ge11-20020a05621427cb00b0066d0f94522dmr3199943qvb.47.1698413564888; Fri, 27 Oct 2023 06:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698413564; cv=none; d=google.com; s=arc-20160816; b=srOf1r4MeFnlWXBQ2ShyYLZaD1Fxawxea5eUEqe21CnxlAHr3nqTDophjGjCYDIUcE afZIoaHwFw9413cbQGkJCgdkDyBu1stwtpZUx6p5ZH/EqoWQXGafFTO9UGYGJ7sFIA5S blC9+pUTRxC9CSk6VAzpEjzZj7DzUKQagjGCI4qVgfADKluBG3KZkV5UT3KMIBEZ5mgo pcX0wPyjbRNUbzwA/78cJu66tO2WVJwgDBby1hO8HGHsZZ3e3XJ2JfjAra+ZaBEVagK1 fUa48MjQztJG5/SbYdj+WIa051CRz8ihlGYE2bNzk7dTqiNvgLbBnpLQtTyKPSXov2UR ce/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-id:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=mY1QMtU10YTGcoYKqVFl5ziFfQiDDa0vKnfSUDYCU2M=; fh=9HYKVq73O00vH9XuUmlKVBmz82Gyb20rCUblPM5xHHw=; b=Yzm7y/jm3c8UElLx3EqSObglMjt71njtCf7goB8IgnfOCrcJkXqk2Fs2biA5fOpB+w NbaA1UBnKiCGSZJk8ZkEXLOvjYRL7kTYB+OumNwd3sdhTWIiZze8i/kRtEr+me4RVcYZ hM/a8F2Ftuc3vSH8NdJk0oyOX9kaWap5kty3JG7yTrnSNHb11sFL8oFwl/9WMWphPBux +CaQ0N1ugKu3mV7lj1nMHNJUHq/CNqPtHM0gdzsCqSX9U95KHuh7TjBApjWqsr+tMVVf ssRLv7uyu1j0mmIVkLVmLQnPxc3GMFPCCFJRDXlzLw3fbxyUQ8v6mdcUJQVlyZP7l7Dt ALJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=erdwTc4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id oq22-20020a05620a611600b007789a6caf87si665628qkn.557.2023.10.27.06.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 06:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=erdwTc4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7D53D804DD95; Fri, 27 Oct 2023 06:30:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345926AbjJ0Naq (ORCPT + 99 others); Fri, 27 Oct 2023 09:30:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345688AbjJ0Nap (ORCPT ); Fri, 27 Oct 2023 09:30:45 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E762CC9; Fri, 27 Oct 2023 06:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698413442; x=1729949442; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=QCDoj2tqsubRZPmLxziPZaPfWsoY1N+hG+KAi9DSmew=; b=erdwTc4jdJWcHDkizPryviQfbnJY/J50pYNwh3v167MeFEooQC8MgNlV X8hK7tpUjuQr/xmvVSem5Ojo1DDY6NpqU9qs8G0dwcaMyNrEJ4JNr92Nb UrPMUtEBvwhTirIM8sBKITvtvNaZA1OmZMWezeAqOdTdgZRIuclclTPvP rM/PQa3nvTPOr5y3ZwqTbVqsYuDfEWQkreMQiAqYOrcNuDHnu7elybOeN OqY0w4S/j8uvDi/Njp2hR+Zy2A/FFjsvSSLtZ+PF+LeCtJ2gTTSM9FXEW GCYO7fro9KOcQnf7W92AWaEDLaN5mCqwz7kg8ITMHVZVWTufxKvZfgS9f w==; X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="387588301" X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="387588301" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 06:30:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="825338480" X-IronPort-AV: E=Sophos;i="6.03,256,1694761200"; d="scan'208";a="825338480" Received: from scoltan-mobl.ger.corp.intel.com ([10.252.33.159]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 06:30:40 -0700 Date: Fri, 27 Oct 2023 16:30:38 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: =?ISO-8859-15?Q?Maciej_Wiecz=F3r-Retman?= cc: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , Fenghua Yu , LKML Subject: Re: [PATCH 21/24] selftests/resctrl: Get resource id from cache id In-Reply-To: Message-ID: References: <20231024092634.7122-1-ilpo.jarvinen@linux.intel.com> <20231024092634.7122-22-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1571728692-1698412161=:2740" Content-ID: <966c938-5a3a-e5ed-cbb-b79630fb836a@linux.intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 06:30:51 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1571728692-1698412161=:2740 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Fri, 27 Oct 2023, Maciej Wiecz?r-Retman wrote: > On 2023-10-24 at 12:26:31 +0300, Ilpo J?rvinen wrote: > >Resource id is acquired differently depending on CPU. AMD tests use id > >from L3 cache, whereas CPUs from other vendors base the id on topology > >package id. In order to support L2 CAT test, this has to be > >generalized. > > > >The driver side code seems to get the resource ids from cache ids so > >the approach used by the AMD branch seems to match the kernel-side > >code. It will also work with L2 resource IDs as long as the cache level > >is generalized. > > > >Using the topology id was always fragile due to mismatch with the > >kernel-side way to acquire the resource id. It got incorrect resource > >id, e.g., when Cluster-on-Die (CoD) is enabled for CPU (but CoD is not > >well suited for resctrl in the first place so it has not been a big > >issues if test don't work correctly with it). > > "not been a big issues" -> "not been a big issue"? > > "if test don't work correctly" -> "if test doesn't work correctly" / "if tests > don't work correctly"? > > > > >Taking all the above into account, generalize the resource id > >calculation by taking it from the cache id and do not hard-code the > >cache level. > > In x86/resctrl files group of CPUs sharing a resctrl resource is called a > domain. Because of that I think "resource id" terms should be substituted with > "domain id" to match core resctrl code. Okay, I was just using the terminology which pre-existed in the selftest code. I've really tried to look how I should call it but things were quite inconsistent. The selftest uses resource id and reads it from cache id. Documentation uses "instances of that resource" or "cache id" or "domain x". Documentation/arch/x86/resctrl.rst is very misleading btw and should be IMHO updated: Memory bandwidth Allocation (default mode) ------------------------------------------ Memory b/w domain is L3 cache. :: MB:=bandwidth0;=bandwidth1;... It claims "domain" is L3 cache (and the value we're talking about is called "cache_id" here which is what you just called "domain id"). I suppose it should say "b/w resource is L3 cache"? -- i. --8323329-1571728692-1698412161=:2740--