Message ID | 684da427338d68b216c1f5636a4930bba06f7b60.1696493034.git.maciej.wieczor-retman@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2016:b0:403:3b70:6f57 with SMTP id fe22csp339770vqb; Thu, 5 Oct 2023 07:32:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvkEjnOWRTV6Nv829s55Gz+YZHlojI5xHETgBfGdctuomesnCVKWkhr+NQLAJF/vmMCZeZ X-Received: by 2002:a05:6a00:1595:b0:68f:cb69:8e66 with SMTP id u21-20020a056a00159500b0068fcb698e66mr4285601pfk.15.1696516348799; Thu, 05 Oct 2023 07:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516348; cv=none; d=google.com; s=arc-20160816; b=Q/G8YO3pVWzTJmLwjwnNxaB9GzF0l8lwp4rXehtAub9TouOmz241Syr03rd3ddGwDs ZPSzy7VaXH5Z4ogUMEuQeO/3me3s5oSHScwLJFkk2OehXNfks6LOJDRf1+PGIBc9j/L5 /N+N54va4ZdzmDcxdxc3d13b6YtalFzeOODpt7rSiMp7IZnUsv6VGyxnepnawWXvy5Lg Si1dk4rL+oBMN6pPAsVROUpyusTnNs0RcB0suTs/zGkAbebHd4A5bMwBvrDEq20xJRFm mmHfTf1EcmjrLrMAIxQmiKDzEElgyjg4ae8AtiuLELiHsb8+ZpTYg5sBqamQRM4+Ews4 CWIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fuUFXb8zzLiV2rWPwRJEEE78D5kv1fWpAVZakdJ1Quk=; fh=taTM0Ub91m2QPo770QmKUJX9+RhaD+q65yPrlZgvRRU=; b=GTdVAqv1Rw0B2cpfLEig23QhvxneQcAAiANW55Mbt4eBbhmAoPvYLI8smPzFJJwGF2 E3ivesZWvYDRJ6qSRKgp1UH/+ur7BrTYUizg4P6WHycNA8KnKWDrh/YScO1/BDiwrA9V Yg8UejJ/CIiegY55Mvt31R4lnZB7vIErtXRXtomU4ocUf717mayq1dgMLs9mkFhV4rnA dUHNGppSJAP+sYExg6+E0p1nre/tnYl5K4yVgadIEq00Er9czk1sMoQVbnY9/jZLtxM+ pfKeOgS9pr3zszjROuJGtpq+WiyMXxwtPQY6pDLlsAaxBNmZqrvKgQPXDtAhh3xdUStT jhSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ByEtnrW5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j9-20020a654309000000b00584ca259597si1490859pgq.538.2023.10.05.07.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ByEtnrW5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 1C23985BE6EC; Thu, 5 Oct 2023 07:32:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235267AbjJEOb5 (ORCPT <rfc822;ezelljr.billy@gmail.com> + 19 others); Thu, 5 Oct 2023 10:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233113AbjJEO3k (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Oct 2023 10:29:40 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2A31BD8 for <linux-kernel@vger.kernel.org>; Thu, 5 Oct 2023 06:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696513800; x=1728049800; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RsEbDDQE5OYZlZy6VBAukZsVljHVFXdnty31uYM0gh0=; b=ByEtnrW5zzrBBsyY/z9L0ZlGTgPCSrIE3GyP9YUAvLks0Jt3kAECq5id WB2YdY6LVIUsCrMXwnKJKzyTjduHDfgPHQxE5EiedJLvLIFjR9wyHv+jd HcAS1lGpBd5noe0q4BEGs+or9ZMhfPQnZ3xFxUbDwk8Jqg+I6CvVokA3u B20ePqOUbPQvWkZPVqRRnodsZ+uGmIY5WS96RJ2VILkVe4S68w50B9pzJ Ao2+u2tjd+2HiQbZBl43SAFW0zyftJtUNcBGjH2nch/653FK9eZnyFMns aKgpElqpSA05U081/19/MvT68TlXRe/uWGBwVOQ9Dd/LDDOBy5WDkBp03 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="383339446" X-IronPort-AV: E=Sophos;i="6.03,202,1694761200"; d="scan'208";a="383339446" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 01:16:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="875477034" X-IronPort-AV: E=Sophos;i="6.03,202,1694761200"; d="scan'208";a="875477034" Received: from lpopiela-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.13.229]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 01:16:18 -0700 From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> To: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com> Cc: Peter Newman <peternewman@google.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/4] x86/resctrl: Add sparse_masks file in info Date: Thu, 5 Oct 2023 10:15:38 +0200 Message-ID: <684da427338d68b216c1f5636a4930bba06f7b60.1696493034.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <cover.1696493034.git.maciej.wieczor-retman@intel.com> References: <cover.1696493034.git.maciej.wieczor-retman@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: <linux-kernel.vger.kernel.org> 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, 05 Oct 2023 07:32:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778926326918581023 X-GMAIL-MSGID: 1778926326918581023 |
Series | x86/resctrl: Non-contiguous bitmasks in Intel CAT | |
Commit Message
Maciej Wieczor-Retman
Oct. 5, 2023, 8:15 a.m. UTC
From: Fenghua Yu <fenghua.yu@intel.com> Add the interface in resctrl FS to show if sparse cache allocation bit masks are supported on the platform. Reading the file returns either a "1" if non-contiguous 1s are supported and "0" otherwise. The file path is /sys/fs/resctrl/info/{resource}/sparse_masks, where {resource} can be either "L2" or "L3". Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Tested-by: Peter Newman <peternewman@google.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> --- Changelog v4: - Add Ilpo's reviewed-by tag. - Add Reinette's reviewed-by tag. Changelog v3: - Add Peter's tested-by and reviewed-by tags. - Reword patch message slightly. (Reinette) Changelog v2: - Change bitmap naming convention to bit mask. (Reinette) - Change file name to "sparse_masks". (Reinette) arch/x86/kernel/cpu/resctrl/rdtgroup.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
Comments
On 10/5/2023 3:15 AM, Maciej Wieczor-Retman wrote: > From: Fenghua Yu <fenghua.yu@intel.com> > > Add the interface in resctrl FS to show if sparse cache allocation > bit masks are supported on the platform. Reading the file returns > either a "1" if non-contiguous 1s are supported and "0" otherwise. > The file path is /sys/fs/resctrl/info/{resource}/sparse_masks, where > {resource} can be either "L2" or "L3". > > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> > Tested-by: Peter Newman <peternewman@google.com> > Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > Reviewed-by: Peter Newman <peternewman@google.com> > Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> > --- > Changelog v4: > - Add Ilpo's reviewed-by tag. > - Add Reinette's reviewed-by tag. > > Changelog v3: > - Add Peter's tested-by and reviewed-by tags. > - Reword patch message slightly. (Reinette) > > Changelog v2: > - Change bitmap naming convention to bit mask. (Reinette) > - Change file name to "sparse_masks". (Reinette) > > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 725344048f85..945801898a4d 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -895,6 +895,17 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of, > return 0; > } > > +static int rdt_has_sparse_bitmasks_show(struct kernfs_open_file *of, > + struct seq_file *seq, void *v) > +{ > + struct resctrl_schema *s = of->kn->parent->priv; > + struct rdt_resource *r = s->res; > + > + seq_printf(seq, "%u\n", r->cache.arch_has_sparse_bitmasks); > + > + return 0; > +} > + > /** > * rdt_bit_usage_show - Display current usage of resources > * > @@ -1839,6 +1850,13 @@ static struct rftype res_common_files[] = { > .seq_show = rdtgroup_size_show, > .fflags = RF_CTRL_BASE, > }, > + { > + .name = "sparse_masks", > + .mode = 0444, > + .kf_ops = &rdtgroup_kf_single_ops, > + .seq_show = rdt_has_sparse_bitmasks_show, > + .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, > + }, > > }; >
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 725344048f85..945801898a4d 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -895,6 +895,17 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of, return 0; } +static int rdt_has_sparse_bitmasks_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + struct resctrl_schema *s = of->kn->parent->priv; + struct rdt_resource *r = s->res; + + seq_printf(seq, "%u\n", r->cache.arch_has_sparse_bitmasks); + + return 0; +} + /** * rdt_bit_usage_show - Display current usage of resources * @@ -1839,6 +1850,13 @@ static struct rftype res_common_files[] = { .seq_show = rdtgroup_size_show, .fflags = RF_CTRL_BASE, }, + { + .name = "sparse_masks", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdt_has_sparse_bitmasks_show, + .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + }, };