Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2718715rwb; Mon, 19 Sep 2022 09:00:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4caVL6MrNZMelGky7kQGqT0bYh3Tk3MI/vXYr1p5yZ4hWh6bUe/b9DKjzD8dmCI5Lc0/y+ X-Received: by 2002:a63:e17:0:b0:42c:7046:3780 with SMTP id d23-20020a630e17000000b0042c70463780mr16602454pgl.352.1663603244027; Mon, 19 Sep 2022 09:00:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663603244; cv=pass; d=google.com; s=arc-20160816; b=zmn+5U35AYv4JCoyMJd4MOfCyMKBPc2G2YvsbxRWZC9teB6yZHzf1UiClFzc9xR3JT 5yvChEgm01uDxs6p8pGkDh3DclWPDeJ7wLDn3NqlxEt9XKPiuW+NYivhf/L+uMKN8GY+ 1kPVkKpPnWmd4Uv2YgVqRW9b3XKlDPV6AOy54kRZfIqfkS56WR7B8omxCyPybIPH8YR+ ebFbCcpkc3BRGYfi7lj1TAw/Xb3motohRfyrujYJesE3ROUzsgBBl4qUZ+P0XeSxSRxQ GlBMLveic+vthSKiDoSueUM3VEfZnr3yl8W02mnh8TAF7oyvA6HcpI9R69chQXc7NBWW dPbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject:reply-to :user-agent:date:message-id:dkim-signature; bh=ixFXGlLARMG+wFx4NyS1cKz/vAXnc2BHUDYEcZ3WPX0=; b=BHCu+1NIoDze5q/ACDEkj4Cs/qYr1PKc1VLiTzaRGWc4fCqe7a8/1VH4QcfkxAQbjA 8G1VDO1aFBr7PYzsPEEgmQwvdRHaCmPrp7UMbCW40SoQ3izVYkHzIOrKARrvf/NqXSdz V3VvL96L7cqn6bjxXKKnnIn9jDP/eQRA1Da28AUJgPDU+ggT4MKTsu1/ocMEJOSgXo4g W0zbF86sQsDwwbrkkLpsp/M8C1fwrhh3IVv/7oLgThS6KJMfl+lxgZcD8FaFMIEh35+j dAXeHdHjYR4BBbxeGVgQC+c2pVyhgW0pB0+TubGHNHPs8PFVIwfl7hmKztWL3jM15N+q 6qpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=FuY9S9tX; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020a170903200200b00176a427be87si27966536pla.437.2022.09.19.09.00.31; Mon, 19 Sep 2022 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=FuY9S9tX; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230293AbiISPrB (ORCPT + 99 others); Mon, 19 Sep 2022 11:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbiISPq4 (ORCPT ); Mon, 19 Sep 2022 11:46:56 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB6682CE05; Mon, 19 Sep 2022 08:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3tgyZSAnPQk/St5G31aMNJ26d8OF1y1gZjoCmBYmtijlx8AAp1slsnaWF/SEdab5Qhye0JzOi+s71dA4xxmLdQpfePMxzpnKCDZF/Mar46b8qSCem3shoJdsz7EPPGIDKarqvGI7w1T0Pa4fiBvCauFcuTGI4nAz0VIUMHY6fG8/E6rlquinfWbqtFUN4/bn2GK0UVko2tUApxnYi+Gf4kW8mEnJWppVQ8C8FXnVP02imWIP54UbP7aTeGR/ghBbTy6Yjonz9VSCt+f3AbP791GAadfX1UKYSbvYUwJ/eM6G5hvkrF8ZTiMb9njR8HMYSxMvmsHPpmeGHig98mFQw== 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=ixFXGlLARMG+wFx4NyS1cKz/vAXnc2BHUDYEcZ3WPX0=; b=cZb8PoozNwnaQCaiWUCL3xsPYk41NMb5aEh218JdBSRFSl77bgjwl265jlI9fohQbKRdWMCIK+FGiW1kb28vk3hwudndDoM3dQ64nuZMfkRjcIjoMD5/fh8kCGh95aITCO8aerRFeu1hGPF9TtQ/rDGzBOu8Okg87NpsQwqu/Q2eqtAqR/1i3DggdNsKBKPAs4ELhd4yKf1l+QTVzvld10eHEOUCDNyeJdqWV77RR/nefi5BTLDuZ9i7pczIbdjuk89ku9k5XqahhNXg0HwqfuNjEjSq2Kx1+SAIsDMmPReimtNca5UWKj/MbNM9tGHTclK8OW/H7BZMjywjcZKXoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=ixFXGlLARMG+wFx4NyS1cKz/vAXnc2BHUDYEcZ3WPX0=; b=FuY9S9tXWODflqyj2qfDzNaQDBsVlmnH57wBmVSbNJEBP5HRKJkoDzA80xzFxGHdzCl+ENsPKXStDMbYrr/Xl8K2rntoDoC6I9bC6PzPcUdyiyCkZCkNizoCUuAhMDdT2O/B9d2vbFnIHhrq7T1NyAG+DxEztswl50h6rRQVk44= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by SJ0PR12MB5407.namprd12.prod.outlook.com (2603:10b6:a03:3ac::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 15:46:52 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::4120:60cf:46a8:7109]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::4120:60cf:46a8:7109%7]) with mapi id 15.20.5632.021; Mon, 19 Sep 2022 15:46:52 +0000 Message-ID: <04132d34-c69e-62a0-35ba-bafa44210c0a@amd.com> Date: Mon, 19 Sep 2022 10:46:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Reply-To: babu.moger@amd.com Subject: Re: [PATCH v4 09/13] x86/resctrl: Add sysfs interface files to read/write event configuration Content-Language: en-US To: Reinette Chatre , corbet@lwn.net, 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, 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 References: <166257348081.1043018.11227924488792315932.stgit@bmoger-ubuntu> <166257366204.1043018.4834615270384002210.stgit@bmoger-ubuntu> <13294a8f-e76f-a6a9-284c-67adbc80ec7c@intel.com> From: "Moger, Babu" In-Reply-To: <13294a8f-e76f-a6a9-284c-67adbc80ec7c@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BL1PR13CA0308.namprd13.prod.outlook.com (2603:10b6:208:2c1::13) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|SJ0PR12MB5407:EE_ X-MS-Office365-Filtering-Correlation-Id: 6535dfd5-273f-4c77-18cf-08da9a562c27 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BWza8J+ed28Dds7aOqulZOSEjo853Ay5ySzEbq2T9289RcvvwjstabGnRz21DiE0GUKtvFkV38ymZu5wyYzmnU75l9sZ6GwI6/Piz8gmJ9pK9xJHy1l4UI+XGL3VB4KGQSSXdfRsvyl9i6tMQdrm9aYbphVi/0Sd0nC/A0lL7zYOk9BJbwIRlm+9vZcmn2mYItm/n1NS7rKGY2wdHl67K2AeVOWvK2RgCn6x6vvYX8YtOFpi+c38ZED9nixRgApXe5/vNjgcjkTdW/1l9HHdq0Kkf2EHHalS/MbLhXtdAzFzhbagS4F2ZngrJgQQfucoqD8ZzviBb9H1pNSOR9SV8R6Ob5dSCSOW9imJ7Uzx4o5r2Lj5HowdYgcB3JsntY6huLkjksYjAq3km1NLhh0yxXmC7GJbZYsatRlh62T+07a9qrRBfISMlHCuYquR4TFPI+PXxRVnQ4E7hjmbrTvdtIbNSIRUop5R+dVXnRYIZTsmD+IIh/mpzgZn59qnwYy06h2N2h3WHGGKdFpGghQsnStQ/uO3JUaXbvt5YMt+WuruyTo5ag14gaWlE3gwFYJqkOHIbYqh5L+YSB7P/MQVEDssbhjLfWK3IiRa0TZ9D6OKdlkTXJ5Bh5EgNp9FmCdPR6ntCYpZEEKYhxjzSCF+J0uLvFtV5FFyLjcGxvzCeoODUcb2XBb66ZXK+OxUUE1IZdn+NFo2LYugN5myjjPgQ3npwhqy2F5D1KXeZsrBnokW7D1pvFBcoQ6hJazr9tqBYfmbgm1JgdS3z1Di4NOtUjvuVjvcSlXmMrkXyd4lU5A= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(451199015)(2616005)(53546011)(83380400001)(6506007)(186003)(6512007)(26005)(66556008)(66476007)(66946007)(8676002)(7416002)(5660300002)(4326008)(478600001)(36756003)(8936002)(31696002)(86362001)(6486002)(6666004)(41300700001)(316002)(38100700002)(31686004)(3450700001)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M2NSZHhJanl3ZEgzL0ZmZ0lGc3IyOHJhaHk2bGJzSUFjbUFlWEhHaEUxT0Jx?= =?utf-8?B?MlNiUEY2b0o4bnFNbmpZSWxmOXhSQWVKRXZxTTl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c01DVjhDMTJFKy8zQ1F4MjhuQXNwc2J1eG1wUDRyZUZMbktNMGpTeHlp?= =?utf-8?B?b2FDN0hUY3hBYXdWLzlJMGtmZ1picmxsZno5dVRIVDRoTzJvK3ZOcjM5b3Jv?= =?utf-8?B?MlNHZ0NHcGVOMUoyZXVkYS9pdVVsUUU5anlzTGhPZVozZVRCT1k1NER3N1U1?= =?utf-8?B?UTdIYkdmTTIrK3NVNmYvZUxRVGFMQlBEU1N0bzVHaURGQnhtOHlXS01TUCtG?= =?utf-8?Q?tllUDxrUvxdKKZOcLqPYkDnYC?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6535dfd5-273f-4c77-18cf-08da9a562c27 X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 15:46:52.6845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UT6UkjyV0EZlMXiRf98cd2S25OV3R/moqdCXyBcVWr1UO7QfcfpH5jfBDLeqwQvY X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5407 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 Hi Reinette, On 9/16/22 10:58, Reinette Chatre wrote: > Hi Babu, > > On 9/7/2022 11:01 AM, Babu Moger wrote: >> Add two new sysfs files to read/write the event configuration if >> the feature Bandwidth Monitoring Event Configuration (BMEC) is >> supported. The file mbm_local_config is for the configuration >> of the event mbm_local_bytes and the file mbm_total_config is >> for the configuration of mbm_total_bytes. >> >> $ls /sys/fs/resctrl/mon_data/mon_L3_00/mbm_local* >> /sys/fs/resctrl/mon_data/mon_L3_00/mbm_local_bytes >> /sys/fs/resctrl/mon_data/mon_L3_00/mbm_local_config >> >> $ls /sys/fs/resctrl/mon_data/mon_L3_00/mbm_total* >> /sys/fs/resctrl/mon_data/mon_L3_00/mbm_total_bytes >> /sys/fs/resctrl/mon_data/mon_L3_00/mbm_total_config >> > This patch makes the mbm*config files per monitor group. Looking > ahead at later patches how the configuration is set it is not clear > to me that this is the right place for these configuration files. > > Looking ahead to patch 10 there is neither rmid nor closid within > the (MSR_IA32_EVT_CFG_BASE + index) register - it only takes > the bits indicating what access types needs to be counted. Also > in patch 10 I understand that the scope of this register is per L3 cache > domain. Yes. Scope of  MSR_IA32_EVT_CFG_BASE per L3 domain. > > Considering this, why is the sysfs file associated with each > monitor group? Please see the response below. > > For example, consider the following scenario: > # cd /sys/fs/resctrl > # mkdir g2 > # mkdir mon_groups/m1 > # mkdir mon_groups/m2 > # find . | grep mbm_local_config > ./mon_data/mon_L3_00/mbm_local_config > ./mon_data/mon_L3_01/mbm_local_config > ./g2/mon_data/mon_L3_00/mbm_local_config > ./g2/mon_data/mon_L3_01/mbm_local_config > ./mon_groups/m2/mon_data/mon_L3_00/mbm_local_config > ./mon_groups/m2/mon_data/mon_L3_01/mbm_local_config > ./mon_groups/m1/mon_data/mon_L3_00/mbm_local_config > ./mon_groups/m1/mon_data/mon_L3_01/mbm_local_config > > > From what I understand, the following sysfs files are > associated with cache domain #0 and thus writing to any of these > files would change the same configuration: > ./mon_data/mon_L3_00/mbm_local_config > ./g2/mon_data/mon_L3_00/mbm_local_config > ./mon_groups/m2/mon_data/mon_L3_00/mbm_local_config > ./mon_groups/m1/mon_data/mon_L3_00/mbm_local_config > > Could you please correct me where I am wrong? For example, we have CPUs 0-7 in domain 0. We have two counters which are configurable. Lets consider same example as your mentioned about. g2 is a control group. m1 and m2 are monitor group. We can have control group g2 with CPUs 0-7 to limit the L3 bandwidth (or memory bandwidth with required schemata setting). We can have mon group m1 with cpus 0-3 to monitor mbm_local_bytes. We can have mon group m2 with cpus  4-7 to monitor mbm_total_bytes. Each group is independently, monitoring two separate thing. Without having sysfs file (mbm_local_config and mbm_total_config) in each monitor group, we wont be able to configure the above configuration. > >> Signed-off-by: Babu Moger >> --- >> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 40 ++++++++++++++++++++++++-------- >> 1 file changed, 30 insertions(+), 10 deletions(-) >> >> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> index f55a693fa958..da11fdad204d 100644 >> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> @@ -254,6 +254,10 @@ static const struct kernfs_ops kf_mondata_ops = { >> .seq_show = rdtgroup_mondata_show, >> }; >> >> +static const struct kernfs_ops kf_mondata_config_ops = { >> + .atomic_write_len = PAGE_SIZE, >> +}; >> + > Please use coding style (tabs vs spaces) that is consistent with area > you are contributing to. Sure > >> static bool is_cpu_list(struct kernfs_open_file *of) >> { >> struct rftype *rft = of->kn->priv; >> @@ -2478,24 +2482,40 @@ static struct file_system_type rdt_fs_type = { >> .kill_sb = rdt_kill_sb, >> }; >> >> -static int mon_addfile(struct kernfs_node *parent_kn, const char *name, >> +static int mon_addfile(struct kernfs_node *parent_kn, struct mon_evt *mevt, >> void *priv) >> { >> - struct kernfs_node *kn; >> + struct kernfs_node *kn_evt, *kn_evt_config; >> int ret = 0; >> >> - kn = __kernfs_create_file(parent_kn, name, 0444, >> - GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0, >> - &kf_mondata_ops, priv, NULL, NULL); >> - if (IS_ERR(kn)) >> - return PTR_ERR(kn); >> + kn_evt = __kernfs_create_file(parent_kn, mevt->name, 0444, >> + GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0, >> + &kf_mondata_ops, priv, NULL, NULL); > Please run your series through checkpatch (alignment issue above) Sure > >> + if (IS_ERR(kn_evt)) >> + return PTR_ERR(kn_evt); >> >> - ret = rdtgroup_kn_set_ugid(kn); >> + ret = rdtgroup_kn_set_ugid(kn_evt); >> if (ret) { >> - kernfs_remove(kn); >> + kernfs_remove(kn_evt); >> return ret; >> } >> >> + if (mevt->configurable) { >> + kn_evt_config = __kernfs_create_file(parent_kn, >> + mevt->config_name, 0644, >> + GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0, >> + &kf_mondata_config_ops, priv, NULL, NULL); >> + if (IS_ERR(kn_evt_config)) >> + return PTR_ERR(kn_evt_config); >> + > Since an error is returned here it seems that some cleanup (kn_evt) is missing? Yes. That is correct.  Will fix it. Thanks Babu > > >> + ret = rdtgroup_kn_set_ugid(kn_evt_config); >> + if (ret) { >> + kernfs_remove(kn_evt_config); >> + kernfs_remove(kn_evt); >> + return ret; >> + } >> + } >> + >> return ret; >> } >> > Reinette -- Thanks Babu Moger