Message ID | 167537444491.647488.11815488030989406143.stgit@bmoger-ubuntu |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491102wrn; Thu, 2 Feb 2023 13:50:47 -0800 (PST) X-Google-Smtp-Source: AK7set9fKCrOvEMISLGRXTpC3CFYjIhpoDjvFArrxmHpaLMXWO5HE6XsaGwb78PmOZ9+2/8UUbdE X-Received: by 2002:a17:907:9724:b0:88d:d76d:8527 with SMTP id jg36-20020a170907972400b0088dd76d8527mr10496592ejc.47.1675374647755; Thu, 02 Feb 2023 13:50:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374647; cv=pass; d=google.com; s=arc-20160816; b=bkzpfTovCSW98QN0gMQfj6OiNjW6MuTOF5PsDstzorrp3wtwnbn+T7MAGi88Uw8rKF yZ/sw2lXx853aCkzat6gSBnl1AZEYrquJ4HBNGCrrml6/2h3gB2HLwjzsvNiny42yXrW 3WHZy12h3s2EEyuJ3M/8lFGpFZTuiZ9TFgeAjO4AmdHWykSJnEQuOGOARsZSvQuGBKAx y/Kyqus4zfZPZ0rcQ9rXB0xk/9NUREbzHawvrwww7wrEPtvZ9DCqs9PSRq+j8rsV76Zh xnfkH11kgRs5wGYBb/y5OISLf+qORm3R/DD1UfwyGc3Hfp+I0kAHKdUZNCgdbFPdsX5h ilVw== 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 :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=VYuMDmsod6qrAXR4MZtDY2ef7GMEydcm5u/0TIGk89I=; b=iDE1DpfkNkdh7PxzHrihUpoBSF6wdFM9Q3EZnWEyj6dEjGrSLmq2jCGImp+IaqJhXS A2+OBbvjZKYVXPurCQKrwmddwer8W2sAvFG2g51luFZhB3lvkkpmtZDpHKqqbAJHBtgf GUpLiDWiIrIljnpVc6RxwJi/EFjDxxSdT+bOgK3vu7cmjvXZWLZebY+HY/1Frz9Epbp8 WYPZOcfePmUHiL4rvjzHuZyx+IKCPsDPw4ue+2+R17Pes3zRaYCppaioA17VBQpM/Gwc nG0DVigg1MOa2zMZ69Ht8wwXjL22mKeGzSxoH7ydoxLwtt39HcNd7sHa7or7IkaqZy2h QNog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Hfqc8Vib; 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 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170906108b00b008897a14f032si979083eju.150.2023.02.02.13.50.24; Thu, 02 Feb 2023 13:50:47 -0800 (PST) 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=Hfqc8Vib; 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 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 S233079AbjBBVrs (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 16:47:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233067AbjBBVrk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 16:47:40 -0500 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2053.outbound.protection.outlook.com [40.107.102.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A633163857; Thu, 2 Feb 2023 13:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dBzGt556nL+fzq9a1EeDbOxN2Qiog/IcIor/DypOV8Tmr9MXY3j6qvEcS1cnivMz5Td6uRbayQh0Sa81U/AZZQGq33w0N8w0JD9Fk32bM0GplxCIsJzkkjRJT/sNhlUXnF+E0rqG1aDboI68d0sUee5VrC/eJH4r2sWiqu2s/QndWYBY2XH1fxHMR1FIeZatLaVvZva0oCzOz/szQjXhFkcr3fEkkxNpmL3AuqBw3FIqeYdivXtlOPfiRXcgJWUFXjvFY3QpLsdrw/FRSErzyARjTWKb6I4xgmOKYhugFjfLh6Jnudm0KI0O0Plonvls/YEW8y2AAKk2d0QBpJGzLA== 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=VYuMDmsod6qrAXR4MZtDY2ef7GMEydcm5u/0TIGk89I=; b=J+/JyF5qC04kKYgsDR6uttYncnMbVNaxJgtkFUXq8BIznqdS5bUEUV3OJIRQnCRvd6lEoS7VDIfuIw1asTojVQzIfwCKZ+vDjXHlZ7fNwgJgTCW0uv3HXXtiq3WfOeYrSKMy8uucjbcmV92i/1tXmIiUbm28d3uWPcJA21fHXOuBSBaOs7VKq0E7m7XMgvhaAdYJYjigTpWt/CEIwmf+efQP7XjT9VYm6apSlNhRqmifuLS7KCgp90PNwKEeorl24VOmdYQoXIs9ENMKvXKUX6xSbcaPjffR3Pyz4cSm5PFiP5WaUq/eFUJi57Ju4gOM1zt1Szm35sQYT/aNxzNeDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=zytor.com 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=VYuMDmsod6qrAXR4MZtDY2ef7GMEydcm5u/0TIGk89I=; b=Hfqc8VibCgEQ/uh04P5hEB00bKsWBd6XFvmIdiCaDziSYeBalisRsbxODyy8OZcRVQVtpnMsVxmubOiaa7Kl6uqZAl20JytVGyP/7NUX44LphmQiYYIlQ3WSTUwhKMFtrsLlSH7aZuUuhBKPgnd4TCc+Ig5rCtK4KpYksa2mesY= Received: from MW4P222CA0015.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::20) by LV2PR12MB6016.namprd12.prod.outlook.com (2603:10b6:408:14e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Thu, 2 Feb 2023 21:47:27 +0000 Received: from CO1PEPF00001A63.namprd05.prod.outlook.com (2603:10b6:303:114:cafe::f9) by MW4P222CA0015.outlook.office365.com (2603:10b6:303:114::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.23 via Frontend Transport; Thu, 2 Feb 2023 21:47:27 +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 CO1PEPF00001A63.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.20 via Frontend Transport; Thu, 2 Feb 2023 21:47:26 +0000 Received: from [127.0.1.1] (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.2375.34; Thu, 2 Feb 2023 15:47:25 -0600 Subject: [RFC v2 PATCH 5/7] x86/resctrl: Introduce -o debug mount option From: Babu Moger <babu.moger@amd.com> To: <fenghua.yu@intel.com>, <reinette.chatre@intel.com> CC: <babu.moger@amd.com>, <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>, <corbet@lwn.net>, <linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>, <eranian@google.com>, <peternewman@google.com> Date: Thu, 2 Feb 2023 15:47:24 -0600 Message-ID: <167537444491.647488.11815488030989406143.stgit@bmoger-ubuntu> In-Reply-To: <167537433143.647488.9641864719195184123.stgit@bmoger-ubuntu> References: <167537433143.647488.9641864719195184123.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: CO1PEPF00001A63:EE_|LV2PR12MB6016:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ac4023d-c985-4fa9-1185-08db0567138f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Snn7oB1VtKuVQU/2DodpY1ynsi9NWhAEuW/jhLxrPDG14dJwVFOLz1CT2Z5ILdaG49vQkaDFr+1x2q/kyfUheE3GNnsdfQjc7RLuQbzSVaXu0zlsh1A+J68gZsPPkI3DS1QWYJjy+sFiPjFLPTLgeGZ0FWgh/9V8OzrJMdddGd+hLmJT3T8QBf+QSo7xesEI6JvncnmLs190KVmuPqc6cHdOPpNOXgGWOPE/tSL5w7J0MAFNQQLGWS3P82IkESQACCFpmWNvSwQK5iX9+O0Z3nWCVKd0TTEBlaAnqtNdsjoQGQpt7CKObhXdEpkSPef6TdMgDxuNgnKVyhvd8c/MRbIHxNjvgfHQ6tjwJtIw9gdIxBTnnZNKtUclQ4FTNYsxd0AvT5OmBQA9FMeSw+5bUju30pf5Np3ATsDtesflnR2gnPlBlisgcs3JgQsvNm8VqCvTNva5C8wuIVOqTaqIiNIMi4JE463BYUvpKnw1B3/uA/s2WHM4uZWWpEuIw8PrsAnQibbQQKYg/pOupu6tDzBml42+Z/Io+2VKidBRBAbfJa3dS2uCFrP2jIdlg8MV7oG+6pKelClE4w77axGiOjFf+kFc9Ajx4u4d1YbAvO0VRIfpKrCuYTIkvJcEmxJrGSUJPs7WBmxK4uYZf8AaLdTSz5tnV5fREPewDtGx0rt/uehbavnmUvSV6We0bvMtKLyU+Pat4FIG/rRacIltWfxLsBMibN5EKJ3M6F0F2vC5hGp+F5TozWCJShLc+6hn7u5ltIChtUTifRAwOClpgw== 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:(13230025)(7916004)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199018)(46966006)(40470700004)(36840700001)(70586007)(4326008)(41300700001)(70206006)(8676002)(40480700001)(8936002)(16576012)(110136005)(316002)(5660300002)(54906003)(103116003)(44832011)(356005)(7416002)(186003)(81166007)(2906002)(9686003)(36860700001)(478600001)(40460700003)(16526019)(26005)(426003)(86362001)(82310400005)(47076005)(33716001)(82740400003)(336012)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:26.9252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ac4023d-c985-4fa9-1185-08db0567138f 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: CO1PEPF00001A63.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB6016 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757646643444539?= X-GMAIL-MSGID: =?utf-8?q?1756757646643444539?= |
Series |
x86/resctrl: Miscellaneous resctrl features
|
|
Commit Message
Moger, Babu
Feb. 2, 2023, 9:47 p.m. UTC
Add -o debug option to mount resctrl filesystem in debug mode. Debug
option adds the files for debug purposes.
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
Documentation/x86/resctrl.rst | 2 ++
arch/x86/kernel/cpu/resctrl/internal.h | 1 +
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++++++
3 files changed, 10 insertions(+)
Comments
Hi, Babu, On 2/2/23 13:47, Babu Moger wrote: > Add -o debug option to mount resctrl filesystem in debug mode. Debug > option adds the files for debug purposes. > > Signed-off-by: Babu Moger <babu.moger@amd.com> > --- > Documentation/x86/resctrl.rst | 2 ++ > arch/x86/kernel/cpu/resctrl/internal.h | 1 + > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++++++ > 3 files changed, 10 insertions(+) > > diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst > index 58b76fc75cb7..2c013c5d45fd 100644 > --- a/Documentation/x86/resctrl.rst > +++ b/Documentation/x86/resctrl.rst > @@ -46,6 +46,8 @@ mount options are: > "mba_MBps": > Enable the MBA Software Controller(mba_sc) to specify MBA > bandwidth in MBps > +"debug": > + Lists the debug files in resctrl interface > > L2 and L3 CDP are controlled separately. > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index 6767c85b9699..35a9ee343fe0 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -59,6 +59,7 @@ struct rdt_fs_context { > bool enable_cdpl2; > bool enable_cdpl3; > bool enable_mba_mbps; > + bool debug; > }; > > static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc) > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 18d458a3cba6..9b7813aa6baf 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -2555,6 +2555,7 @@ enum rdt_param { > Opt_cdp, > Opt_cdpl2, > Opt_mba_mbps, > + Opt_debug, > nr__rdt_params > }; > > @@ -2562,6 +2563,7 @@ static const struct fs_parameter_spec rdt_fs_parameters[] = { > fsparam_flag("cdp", Opt_cdp), > fsparam_flag("cdpl2", Opt_cdpl2), > fsparam_flag("mba_MBps", Opt_mba_mbps), > + fsparam_flag("debug", Opt_debug), > {} > }; > > @@ -2587,6 +2589,9 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) > return -EINVAL; > ctx->enable_mba_mbps = true; > return 0; > + case Opt_debug: > + ctx->debug = true; > + return 0; > } > > return -EINVAL; > @@ -3525,6 +3530,8 @@ static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) > if (is_mba_sc(&rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl)) > seq_puts(seq, ",mba_MBps"); > > + seq_puts(seq, ",debug"); Need to add a check here otherwise ",debug" will be always shown regardless "-o debug" is given or not: + if (ctx->debug) + seq_puts(seq, ",debug"); But I don't know a good way to get ctx->debug in this function yet. I think somehow ctx can be retrieved from kf but not sure. > + > return 0; > } > > > Thanks. -Fenghua
Hi Fenghua, On 2/16/2023 7:42 PM, Fenghua Yu wrote: > Hi, Babu, > > On 2/2/23 13:47, Babu Moger wrote: >> Add -o debug option to mount resctrl filesystem in debug mode. Debug >> option adds the files for debug purposes. >> >> Signed-off-by: Babu Moger <babu.moger@amd.com> >> --- >> Documentation/x86/resctrl.rst | 2 ++ >> arch/x86/kernel/cpu/resctrl/internal.h | 1 + >> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++++++ >> 3 files changed, 10 insertions(+) >> >> diff --git a/Documentation/x86/resctrl.rst >> b/Documentation/x86/resctrl.rst >> index 58b76fc75cb7..2c013c5d45fd 100644 >> --- a/Documentation/x86/resctrl.rst >> +++ b/Documentation/x86/resctrl.rst >> @@ -46,6 +46,8 @@ mount options are: >> "mba_MBps": >> Enable the MBA Software Controller(mba_sc) to specify MBA >> bandwidth in MBps >> +"debug": >> + Lists the debug files in resctrl interface >> L2 and L3 CDP are controlled separately. >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h >> b/arch/x86/kernel/cpu/resctrl/internal.h >> index 6767c85b9699..35a9ee343fe0 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -59,6 +59,7 @@ struct rdt_fs_context { >> bool enable_cdpl2; >> bool enable_cdpl3; >> bool enable_mba_mbps; >> + bool debug; >> }; >> static inline struct rdt_fs_context *rdt_fc2context(struct >> fs_context *fc) >> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> index 18d458a3cba6..9b7813aa6baf 100644 >> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> @@ -2555,6 +2555,7 @@ enum rdt_param { >> Opt_cdp, >> Opt_cdpl2, >> Opt_mba_mbps, >> + Opt_debug, >> nr__rdt_params >> }; >> @@ -2562,6 +2563,7 @@ static const struct fs_parameter_spec >> rdt_fs_parameters[] = { >> fsparam_flag("cdp", Opt_cdp), >> fsparam_flag("cdpl2", Opt_cdpl2), >> fsparam_flag("mba_MBps", Opt_mba_mbps), >> + fsparam_flag("debug", Opt_debug), >> {} >> }; >> @@ -2587,6 +2589,9 @@ static int rdt_parse_param(struct fs_context >> *fc, struct fs_parameter *param) >> return -EINVAL; >> ctx->enable_mba_mbps = true; >> return 0; >> + case Opt_debug: >> + ctx->debug = true; >> + return 0; >> } >> return -EINVAL; >> @@ -3525,6 +3530,8 @@ static int rdtgroup_show_options(struct >> seq_file *seq, struct kernfs_root *kf) >> if (is_mba_sc(&rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl)) >> seq_puts(seq, ",mba_MBps"); >> + seq_puts(seq, ",debug"); > > Need to add a check here otherwise ",debug" will be always shown > regardless "-o debug" is given or not: > + if (ctx->debug) > + seq_puts(seq, ",debug"); > > But I don't know a good way to get ctx->debug in this function yet. I > think somehow ctx can be retrieved from kf but not sure. Yes. Make sense. May be i will have to save it in rdt_hw_resource then I can add that check. Thanks Babu > >> + >> return 0; >> } >> >> > Thanks. > > -Fenghua
diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst index 58b76fc75cb7..2c013c5d45fd 100644 --- a/Documentation/x86/resctrl.rst +++ b/Documentation/x86/resctrl.rst @@ -46,6 +46,8 @@ mount options are: "mba_MBps": Enable the MBA Software Controller(mba_sc) to specify MBA bandwidth in MBps +"debug": + Lists the debug files in resctrl interface L2 and L3 CDP are controlled separately. diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 6767c85b9699..35a9ee343fe0 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -59,6 +59,7 @@ struct rdt_fs_context { bool enable_cdpl2; bool enable_cdpl3; bool enable_mba_mbps; + bool debug; }; static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 18d458a3cba6..9b7813aa6baf 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2555,6 +2555,7 @@ enum rdt_param { Opt_cdp, Opt_cdpl2, Opt_mba_mbps, + Opt_debug, nr__rdt_params }; @@ -2562,6 +2563,7 @@ static const struct fs_parameter_spec rdt_fs_parameters[] = { fsparam_flag("cdp", Opt_cdp), fsparam_flag("cdpl2", Opt_cdpl2), fsparam_flag("mba_MBps", Opt_mba_mbps), + fsparam_flag("debug", Opt_debug), {} }; @@ -2587,6 +2589,9 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) return -EINVAL; ctx->enable_mba_mbps = true; return 0; + case Opt_debug: + ctx->debug = true; + return 0; } return -EINVAL; @@ -3525,6 +3530,8 @@ static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) if (is_mba_sc(&rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl)) seq_puts(seq, ",mba_MBps"); + seq_puts(seq, ",debug"); + return 0; }