Message ID | 20230915224227.1336967-11-babu.moger@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1462373vqi; Fri, 15 Sep 2023 20:53:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkpkTXCsL/ZnqU3LP+7F5Q/kVwl0bIMsa3CErYwJS5bH3K+b9OWG/MhB2t5CIYcReUrLqD X-Received: by 2002:a05:6870:80cf:b0:1d5:e15c:5dba with SMTP id r15-20020a05687080cf00b001d5e15c5dbamr4479086oab.45.1694836392348; Fri, 15 Sep 2023 20:53:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694836392; cv=pass; d=google.com; s=arc-20160816; b=odX9jwKZU4xSVl/fwGALlU4WzdZpjlnUfiGafOlSbApwxKTVLBbiHkbRP69PKPUwcH byvh7KDxkSUJqp0ZoO9ixXqjWUnUOY69VoO17tTNt8Y9UPPSa6j+2o1lblGFmxog4pj6 IzsDeQMeOHijY9hhgZqmdOLFfE/V/wGpEjOeIlLRdsqICxSBCiZmX1j/ofGRn5u9NlEa UJ7mgBa57MxC69Uccg9p0IbabQzNP7iIdeeJviKFo7NvIKsGkRlhLW2JtDuCMJSwM3lq yWA8mWCNL0U/vT0x24YNyaGJcxQ8U+AtAcmPK6SL/TTaXf7XN0JeUxxS1TMhBKSlZlLO 5E9A== ARC-Message-Signature: i=2; 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=I/p/sKy9VU5qZCE4fZmT/UyLRX35DEIdmsn4W41jxy0=; fh=a8QQDpsyeps30vd5Li+WI6v6dtcd7xKVvftia9bksQM=; b=Fp78lGATgV/0dj648+swuZDs88CGpBOokFns4LE/fC2Vpw0cP7TjAPJeYqCuQuorMf CE/LUWzSOe8J91Qz14LeaCtty4FHrFxaUBWHBQy1MzCRJsxmEeM91C0gIm9Q326+70GO 7/MbRMNp9ikSLhE5tPrA8Mae6RcicxhxADlQdqXSgXIFWXy89STc+2yNVhO4aSWHZzMh n2xcUGbjR83fA3qdcyM2O8laZr4VoaXCnkBDaY2t3niMYBuhidiWkZqUzD2/Pak2P0mF I0hveDBesjUFLczQColBR4q45NmtbUcDqxTDodXdXnqN1VJsAnzhSjFkjxKPqnmJoZhT KdCA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HAJ5308u; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z11-20020a65610b000000b0054ff717395dsi4157296pgu.691.2023.09.15.20.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 20:53:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HAJ5308u; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E1973836D262; Fri, 15 Sep 2023 15:47:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238055AbjIOWnX (ORCPT <rfc822;realc9580@gmail.com> + 28 others); Fri, 15 Sep 2023 18:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237975AbjIOWnA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 15 Sep 2023 18:43:00 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5945A269D; Fri, 15 Sep 2023 15:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Coum9UpOAVkEgHjAoo4L9FvimIldMWNubG08+/Th18ifzg42vSt/rxgCRgFQK9RaSDa+9cSRLh1OV8/LuRekfRWTx3wME0/4Ehr7eLrgiH4CTT8/S7uZBdpTbIjj+3wWYQddm03Um1JbF4YCRwKGSfyOZZ1B+jZdNcP34jsLIUduzVaYOu6zJd3RIWRk3EgIU2KKOrP0YH6HLRxXafZmLm0mpDQqfcORKr5PciMqDQ4OPI8iffliO8CAoN6R56zxBkAAvfnjtcgr+li8i9mAZwdieI9SClEsyZRdvPHrv2HDZgWbMgfi1ct90eLtDgdI5m0Znx6OdnBM6B/BNK9DbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I/p/sKy9VU5qZCE4fZmT/UyLRX35DEIdmsn4W41jxy0=; b=P5SfQJMueaTh/It3HqkC/Yl3ZpNWJZxwK8XdZw6KxWAZ4RjuTyHdMHMHl9su9B05pGVi28B/ThdKBabkN37AwcThrZ2gz/6CcKvIU40H0Hwj2vXxV0lUOsCul3hVlsX7icA3T0b2dUbl+iDduBWojHMF6c7fx5RMaBO9znQ/wqgXDpmpLG8SWmnlR38YO6DbiQJC/u3ubDyBT9r5m/QTS8HLMaEyggOuiVQUZqXdIBe034mKk6LdvbEUnxshUjL1ZlqbWEQzRc/azmXMxY6v9YeT32pTpZqphar/ANAVWBCnVdM8unTFUqVfO8ZNkYyYYZd1mXobd7pao8YnPqqslg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I/p/sKy9VU5qZCE4fZmT/UyLRX35DEIdmsn4W41jxy0=; b=HAJ5308uyc+3hSx7MSmwvf4vPE5vWB0emKPLBb6+mdK2B0V0E69VUVY06PGeQeNoVZugUEOl//rWEafC4Tjls4B50LB8cxtYt2rywX/+nzpxpC/xHrLBrYIcDYSeVgx+E53vYh8/ZqmeJmMKXq3Y8CpbZuN/LhYBOW1Og+9HbB0= Received: from CYXPR02CA0038.namprd02.prod.outlook.com (2603:10b6:930:cc::11) by MN2PR12MB4158.namprd12.prod.outlook.com (2603:10b6:208:15f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 22:42:52 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:cc:cafe::38) by CYXPR02CA0038.outlook.office365.com (2603:10b6:930:cc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21 via Frontend Transport; Fri, 15 Sep 2023 22:42:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6792.19 via Frontend Transport; Fri, 15 Sep 2023 22:42:51 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 15 Sep 2023 17:42:49 -0500 From: Babu Moger <babu.moger@amd.com> To: <corbet@lwn.net>, <reinette.chatre@intel.com>, <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de> CC: <fenghua.yu@intel.com>, <dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>, <paulmck@kernel.org>, <akpm@linux-foundation.org>, <quic_neeraju@quicinc.com>, <rdunlap@infradead.org>, <damien.lemoal@opensource.wdc.com>, <songmuchun@bytedance.com>, <peterz@infradead.org>, <jpoimboe@kernel.org>, <pbonzini@redhat.com>, <babu.moger@amd.com>, <chang.seok.bae@intel.com>, <pawan.kumar.gupta@linux.intel.com>, <jmattson@google.com>, <daniel.sneddon@linux.intel.com>, <sandipan.das@amd.com>, <tony.luck@intel.com>, <james.morse@arm.com>, <linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <bagasdotme@gmail.com>, <eranian@google.com>, <christophe.leroy@csgroup.eu>, <jarkko@kernel.org>, <adrian.hunter@intel.com>, <quic_jiles@quicinc.com>, <peternewman@google.com> Subject: [PATCH v10 10/10] x86/resctrl: Display RMID of resource group Date: Fri, 15 Sep 2023 17:42:27 -0500 Message-ID: <20230915224227.1336967-11-babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915224227.1336967-1-babu.moger@amd.com> References: <20230915224227.1336967-1-babu.moger@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CE:EE_|MN2PR12MB4158:EE_ X-MS-Office365-Filtering-Correlation-Id: 642c61b9-e66d-44e6-ce44-08dbb63d1834 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p29ulDix2ut3MqbKemMjmntNx0teSWUcymMG1A46ZVsOE8EIB2RVT4K1FMSHjleo1KaD/6Jd6ifU4gSqSJ18jxm3+bvvxWRlAUeTFpc6RUOSw9sowsyQCnCRDzwuCPd1AzAaACcYXPXifVoiSvg5F9Fw0Tj8zze0nvgf7JwoW8aHDg2GzZ81UOKW60yGxpxCrZI7PyBl/kBr5TaRMCP0UTeB118Le66GaMXi9AdrAOuZJ4rvjx/D2eYHNPq/wj6MjP5TprThrYq0he8+txEC9JVk/2s/BUkEigrZyB3Y6X/B5u1w9t0gJorU/wy9h1DYufkklkMNVNUa+J/ouoCKJaML3MzdBDr1uxFKzu3Emz9t1bcgbbGmOATz2fVBL7/5vLQQ/gZnpWJEvo5j5HHif4/bLGTjpvVVcn7SXFC/OkJ1oAcJwqG3aGYUct2D6rSvnCzr2XDZpUdgtTeUH8qInWPeWpO8u32011Td5bVzUePMBHgEMjtHGNTiZgKoLh9Ri3vYqjQTh0hryr2On33ryU0xQlKBYNZVt1iCRnsupWkEasJ/tM2cTW+2/myqDodlJkZ8w7tPptAoPymYPrnHdDtsGCzq3MTc/+uWyITvSqiuaqskGiGuI7zcjmD/R6hgWkdCKCvw3ij8CEWDZ49c5USkFckyw8dL4X87cZ6suT7CytP6s005/ELJBqGwbH4zl7iDK+FvWUkz8lELCxtwxlyMrebFl3T7l3DDJ8wS4Ipnd8/vYKYWssc9K2v2KFAstspOCgmXU7s1aaYJw0AHww== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(376002)(39860400002)(136003)(346002)(1800799009)(82310400011)(451199024)(186009)(46966006)(40470700004)(36840700001)(6666004)(7696005)(478600001)(5660300002)(26005)(16526019)(426003)(2906002)(336012)(110136005)(316002)(70586007)(7406005)(44832011)(70206006)(54906003)(41300700001)(4326008)(40460700003)(8676002)(47076005)(7416002)(8936002)(86362001)(40480700001)(36860700001)(1076003)(2616005)(36756003)(82740400003)(356005)(81166007)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 22:42:51.7337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 642c61b9-e66d-44e6-ce44-08dbb63d1834 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4158 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 15:47:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777164764717904920 X-GMAIL-MSGID: 1777164764717904920 |
Series |
x86/resctrl: Miscellaneous resctrl features
|
|
Commit Message
Moger, Babu
Sept. 15, 2023, 10:42 p.m. UTC
In x86, hardware uses RMID to identify a monitoring group. When a user
creates a monitor group these details are not visible. These details
can help resctrl debugging.
Add RMID(mon_hw_id) to the monitor groups display in resctrl interface.
Users can see these details when resctrl is mounted with "-o debug" option.
Other architectures do not use "RMID". Use the name mon_hw_id to refer
to "RMID" in an effort to keep the naming generic.
For example:
$cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id
3
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
Documentation/arch/x86/resctrl.rst | 4 ++++
arch/x86/kernel/cpu/resctrl/internal.h | 5 +++++
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 23 +++++++++++++++++++++++
3 files changed, 32 insertions(+)
Comments
Hi Babu, On Sat, Sep 16, 2023 at 12:42 AM Babu Moger <babu.moger@amd.com> wrote: > > In x86, hardware uses RMID to identify a monitoring group. When a user > creates a monitor group these details are not visible. These details > can help resctrl debugging. > > Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > Users can see these details when resctrl is mounted with "-o debug" option. When I reviewed this, I went through the whole series second-guessing the wording above and wondering whether "monitoring groups" applied to CTRL_MON groups. I was able to confirm that mon_hw_id did appear and had a believable value in CTRL_MON groups which had allocated monitors. (and I added some comma-separated PID lists to the tasks node) for the series: Tested-By: Peter Newman <peternewman@google.com> > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index a07fa4329b65..b4910892b0a6 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -296,6 +296,11 @@ struct rdtgroup { > * --> RFTYPE_BASE (Files common for both MON and CTRL groups) > * Files: cpus, cpus_list, tasks > * > + * --> RFTYPE_MON (Files only for MON group) If monitoring is supported, all groups are MON groups. I think the "only" above caused me to second guess whether this takes into account CTRL_MON groups getting the RFTYPE_MON flag set dynamically. However, I think the documentation above is still technically accurate. for the series: Reviewed-By: Peter Newman <peternewman@google.com> Thanks! -Peter
Hi Peter, On 9/22/2023 9:36 AM, Peter Newman wrote: > Hi Babu, > > On Sat, Sep 16, 2023 at 12:42 AM Babu Moger <babu.moger@amd.com> wrote: >> In x86, hardware uses RMID to identify a monitoring group. When a user >> creates a monitor group these details are not visible. These details >> can help resctrl debugging. >> >> Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. >> Users can see these details when resctrl is mounted with "-o debug" option. > When I reviewed this, I went through the whole series second-guessing > the wording above and wondering whether "monitoring groups" applied to > CTRL_MON groups. > > I was able to confirm that mon_hw_id did appear and had a believable > value in CTRL_MON groups which had allocated monitors. (and I added > some comma-separated PID lists to the tasks node) > > for the series: > Tested-By: Peter Newman <peternewman@google.com> Thank you. > >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h >> index a07fa4329b65..b4910892b0a6 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -296,6 +296,11 @@ struct rdtgroup { >> * --> RFTYPE_BASE (Files common for both MON and CTRL groups) >> * Files: cpus, cpus_list, tasks >> * >> + * --> RFTYPE_MON (Files only for MON group) > If monitoring is supported, all groups are MON groups. I think the > "only" above caused me to second guess whether this takes into account > CTRL_MON groups getting the RFTYPE_MON flag set dynamically. > > However, I think the documentation above is still technically accurate. Thanks. If there is another revision, I am open to remove "only" from this text. > > for the series: > Reviewed-By: Peter Newman <peternewman@google.com> Thanks Babu
Hi, Peter, On 9/22/23 07:36, Peter Newman wrote: > Hi Babu, > > On Sat, Sep 16, 2023 at 12:42 AM Babu Moger <babu.moger@amd.com> wrote: >> >> In x86, hardware uses RMID to identify a monitoring group. When a user >> creates a monitor group these details are not visible. These details >> can help resctrl debugging. >> >> Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. >> Users can see these details when resctrl is mounted with "-o debug" option. > > When I reviewed this, I went through the whole series second-guessing > the wording above and wondering whether "monitoring groups" applied to > CTRL_MON groups. > > I was able to confirm that mon_hw_id did appear and had a believable > value in CTRL_MON groups which had allocated monitors. (and I added > some comma-separated PID lists to the tasks node) > > for the series: > Tested-By: Peter Newman <peternewman@google.com> Please use "Tested-by" instead of "Tested-By" (the "By" is wrong). > >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h >> index a07fa4329b65..b4910892b0a6 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -296,6 +296,11 @@ struct rdtgroup { >> * --> RFTYPE_BASE (Files common for both MON and CTRL groups) >> * Files: cpus, cpus_list, tasks >> * >> + * --> RFTYPE_MON (Files only for MON group) > > If monitoring is supported, all groups are MON groups. I think the > "only" above caused me to second guess whether this takes into account > CTRL_MON groups getting the RFTYPE_MON flag set dynamically. > > However, I think the documentation above is still technically accurate. > > for the series: > Reviewed-By: Peter Newman <peternewman@google.com> Please use "Reviewed-by" instead of "Reviewed-By" (the "By" is wrong). Thanks. -Fenghua
On Fri, Sep 22, 2023 at 7:59 PM Fenghua Yu <fenghua.yu@intel.com> wrote: > On 9/22/23 07:36, Peter Newman wrote: > > On Sat, Sep 16, 2023 at 12:42 AM Babu Moger <babu.moger@amd.com> wrote: > >> > >> In x86, hardware uses RMID to identify a monitoring group. When a user > >> creates a monitor group these details are not visible. These details > >> can help resctrl debugging. > >> > >> Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > >> Users can see these details when resctrl is mounted with "-o debug" option. > > > > When I reviewed this, I went through the whole series second-guessing > > the wording above and wondering whether "monitoring groups" applied to > > CTRL_MON groups. > > > > I was able to confirm that mon_hw_id did appear and had a believable > > value in CTRL_MON groups which had allocated monitors. (and I added > > some comma-separated PID lists to the tasks node) > > > > for the series: > > Tested-By: Peter Newman <peternewman@google.com> > > Please use "Tested-by" instead of "Tested-By" (the "By" is wrong). Tested-by: Peter Newman <peternewman@google.com> > > > >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > >> index a07fa4329b65..b4910892b0a6 100644 > >> --- a/arch/x86/kernel/cpu/resctrl/internal.h > >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h > >> @@ -296,6 +296,11 @@ struct rdtgroup { > >> * --> RFTYPE_BASE (Files common for both MON and CTRL groups) > >> * Files: cpus, cpus_list, tasks > >> * > >> + * --> RFTYPE_MON (Files only for MON group) > > > > If monitoring is supported, all groups are MON groups. I think the > > "only" above caused me to second guess whether this takes into account > > CTRL_MON groups getting the RFTYPE_MON flag set dynamically. > > > > However, I think the documentation above is still technically accurate. > > > > for the series: > > Reviewed-By: Peter Newman <peternewman@google.com> > > Please use "Reviewed-by" instead of "Reviewed-By" (the "By" is wrong). Reviewed-by: Peter Newman <peternewman@google.com>
On 9/15/23 15:42, Babu Moger wrote: > In x86, hardware uses RMID to identify a monitoring group. When a user > creates a monitor group these details are not visible. These details > can help resctrl debugging. > > Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > Users can see these details when resctrl is mounted with "-o debug" option. > > Other architectures do not use "RMID". Use the name mon_hw_id to refer > to "RMID" in an effort to keep the naming generic. > > For example: > $cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id > 3 > > Signed-off-by: Babu Moger <babu.moger@amd.com> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Thanks. -Fenghua
Hi Babu, On 9/15/2023 3:42 PM, Babu Moger wrote: > In x86, hardware uses RMID to identify a monitoring group. When a user > creates a monitor group these details are not visible. These details > can help resctrl debugging. > > Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > Users can see these details when resctrl is mounted with "-o debug" option. > > Other architectures do not use "RMID". Use the name mon_hw_id to refer > to "RMID" in an effort to keep the naming generic. > > For example: > $cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id > 3 > > Signed-off-by: Babu Moger <babu.moger@amd.com> > --- Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reinette
On Fri, 15 Sep 2023, Babu Moger wrote: > In x86, hardware uses RMID to identify a monitoring group. When a user > creates a monitor group these details are not visible. These details > can help resctrl debugging. > > Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > Users can see these details when resctrl is mounted with "-o debug" option. > > Other architectures do not use "RMID". Use the name mon_hw_id to refer > to "RMID" in an effort to keep the naming generic. > > For example: > $cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id > 3 > > Signed-off-by: Babu Moger <babu.moger@amd.com> > --- > Documentation/arch/x86/resctrl.rst | 4 ++++ > arch/x86/kernel/cpu/resctrl/internal.h | 5 +++++ > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 23 +++++++++++++++++++++++ > 3 files changed, 32 insertions(+) > > diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst > index 54691c8b832d..98b0eb509ed4 100644 > --- a/Documentation/arch/x86/resctrl.rst > +++ b/Documentation/arch/x86/resctrl.rst > @@ -369,6 +369,10 @@ When monitoring is enabled all MON groups will also contain: > the sum for all tasks in the CTRL_MON group and all tasks in > MON groups. Please see example section for more details on usage. > > +"mon_hw_id": > + Available only with debug option. The identifier used by hardware > + for the monitor group. On x86 this is the RMID. > + > Resource allocation rules > ------------------------- > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index a07fa4329b65..b4910892b0a6 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -296,6 +296,11 @@ struct rdtgroup { > * --> RFTYPE_BASE (Files common for both MON and CTRL groups) > * Files: cpus, cpus_list, tasks > * > + * --> RFTYPE_MON (Files only for MON group) > + * > + * --> RFTYPE_DEBUG (Files to help resctrl debugging) > + * File: mon_hw_id > + * > * --> RFTYPE_CTRL (Files only for CTRL group) > * Files: mode, schemata, size > * > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 55d1b90f460e..ef4b18091e5d 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -795,6 +795,22 @@ static int rdtgroup_closid_show(struct kernfs_open_file *of, > return ret; > } > > +static int rdtgroup_rmid_show(struct kernfs_open_file *of, > + struct seq_file *s, void *v) > +{ > + struct rdtgroup *rdtgrp; > + int ret = 0; > + > + rdtgrp = rdtgroup_kn_lock_live(of->kn); > + if (rdtgrp) > + seq_printf(s, "%u\n", rdtgrp->mon.rmid); > + else > + ret = -ENOENT; > + rdtgroup_kn_unlock(of->kn); > + > + return ret; > +} > + > #ifdef CONFIG_PROC_CPU_RESCTRL > > /* > @@ -1856,6 +1872,13 @@ static struct rftype res_common_files[] = { > .seq_show = rdtgroup_tasks_show, > .fflags = RFTYPE_BASE, > }, > + { > + .name = "mon_hw_id", > + .mode = 0444, > + .kf_ops = &rdtgroup_kf_single_ops, > + .seq_show = rdtgroup_rmid_show, > + .fflags = RFTYPE_MON_BASE | RFTYPE_DEBUG, > + }, > { > .name = "schemata", > .mode = 0644, > Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index 54691c8b832d..98b0eb509ed4 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -369,6 +369,10 @@ When monitoring is enabled all MON groups will also contain: the sum for all tasks in the CTRL_MON group and all tasks in MON groups. Please see example section for more details on usage. +"mon_hw_id": + Available only with debug option. The identifier used by hardware + for the monitor group. On x86 this is the RMID. + Resource allocation rules ------------------------- diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index a07fa4329b65..b4910892b0a6 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -296,6 +296,11 @@ struct rdtgroup { * --> RFTYPE_BASE (Files common for both MON and CTRL groups) * Files: cpus, cpus_list, tasks * + * --> RFTYPE_MON (Files only for MON group) + * + * --> RFTYPE_DEBUG (Files to help resctrl debugging) + * File: mon_hw_id + * * --> RFTYPE_CTRL (Files only for CTRL group) * Files: mode, schemata, size * diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 55d1b90f460e..ef4b18091e5d 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -795,6 +795,22 @@ static int rdtgroup_closid_show(struct kernfs_open_file *of, return ret; } +static int rdtgroup_rmid_show(struct kernfs_open_file *of, + struct seq_file *s, void *v) +{ + struct rdtgroup *rdtgrp; + int ret = 0; + + rdtgrp = rdtgroup_kn_lock_live(of->kn); + if (rdtgrp) + seq_printf(s, "%u\n", rdtgrp->mon.rmid); + else + ret = -ENOENT; + rdtgroup_kn_unlock(of->kn); + + return ret; +} + #ifdef CONFIG_PROC_CPU_RESCTRL /* @@ -1856,6 +1872,13 @@ static struct rftype res_common_files[] = { .seq_show = rdtgroup_tasks_show, .fflags = RFTYPE_BASE, }, + { + .name = "mon_hw_id", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdtgroup_rmid_show, + .fflags = RFTYPE_MON_BASE | RFTYPE_DEBUG, + }, { .name = "schemata", .mode = 0644,