From patchwork Thu Feb 2 21:46:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491301wrn; Thu, 2 Feb 2023 13:51:19 -0800 (PST) X-Google-Smtp-Source: AK7set8pFOUndcvV0Kop/3plk8U20vs4Qqp/F3P0Vmd4Vu6oFfq5xsxZfw2cQ9sVw94aw+9zSxKF X-Received: by 2002:a17:90a:1c4:b0:22c:8161:5143 with SMTP id 4-20020a17090a01c400b0022c81615143mr7971649pjd.31.1675374678787; Thu, 02 Feb 2023 13:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374678; cv=pass; d=google.com; s=arc-20160816; b=RMhANLzmlgSIUFEUiKuRFZnqJr8QCcDwfQmoTjZ5FoOfGvPJz51IFvoCCJ0G72W2M0 kBx5hZIp3cW7IEbAlN/LnGfcrzMscQ7FYy3CrNCWo4rY8MfHa/wQErYlEReEGsxtTGqR sop/v188ineWEF+X2TOjeoq0s8NVjm+Glgi7A6/SPCCP9GuGPqMTfKz0k1hm85Nu2Srv y5ZYFKYKWFhKwUtcxjYORxeS3hyQYBFjfx080xOz+dnB4iINjIr/aMMMqKDPt1e69OvR XSAN6s/6PJ8cK4DghdtSmTl5YL6/I3+1sAkjLfUlodXXmyXCzs/kqhPKus1q5geiOiin z76A== 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=WR4r95AImEpVKDY27H8FWcKXZoDuUBWDqDRBgxdMk0w=; b=SIdbUigVCyFg8fWosjRQ4/LsYa9OE6dfUgryi5vJnmplu2Tw6t5cYHToW8lJUlvrin GduqJnCaTptmePfRe1lktKNz7iZDh2R7CnpsbSqp87h8yWk49EEKR+XNwq4HZVOTMpC8 4Pih/R6DkuI1OMcO0ZcWOmS01BAk1SlgMPxZGlvb+JwaJpYjcB5I1oiC0d7yGNbJzHfI IBWM5vbsgX+ShC07m8QNMs+2nNM+fcm9KnGx4QrP5CUvwk4QCvjPGpWR6apGZzeoJk+U Fvcj01k+oII4CswJR7j1Se3iokV3ULQwc2NL8zT2LYqxqlmj7UdzqzKUDbqP2VRyOZFu e6KA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2loNNyYG; 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 z11-20020a63b90b000000b004dfbe579e2fsi607569pge.577.2023.02.02.13.51.01; Thu, 02 Feb 2023 13:51:18 -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=2loNNyYG; 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 S232990AbjBBVrD (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbjBBVrA (ORCPT ); Thu, 2 Feb 2023 16:47:00 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E971A2E0D0; Thu, 2 Feb 2023 13:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLEL++sS1OoSpsWl2yJXG5lL1eZ3NqynSltY3QgbU6QwyxzxfZT2uLhu6HwcbGtXMS8LwtfM6R8pQEShts+sBDVRqarIvB8odNNXByRsiBpoTIA9qX5FKK9KqIIFrUrrSswbJoKPMOmmhUtSjB7uf3op87jWWOuFzvADRhkEGV6LtPmieRf3F6pHcqYq6+k3j3cAgHQ+zHU6wKnAnOXkAdT88FgNU63PDcS0x495eo4CrPvqfy7OwSmlf7MFqUA+mnlimcL4gUQImX8BN2z2J1KQPta2H4ybsWBpKaajJymMe18D5HUuffrR4oRGRUu3XkFvBz2TWTDbIiBlb3Wyzg== 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=WR4r95AImEpVKDY27H8FWcKXZoDuUBWDqDRBgxdMk0w=; b=e3TItXas0ebGvbYQGUu76R2C28Ztirx228QlzOMTboXlWJzCEZSKOfpzn0mgUbgNr+vXSniGyZT8emYraCpf6eKPtWRFUB9zWHS4/OH6mHwpumGGZEPPPhg93KaVLmN3DQS3FCAol5njbRApw5G91fbOYkVdp8E8CS0UDMqVH7erZ9KkT5OWEBBt6prVwlcNTFKnDVW0acmbxD0DPdTmq/+KtW9nTUEYkuokqTUXfVXVIxxVX+bWcP74YZX1AVG+G3PxzTSgwEwG/hihviAx7//yZcVo166IiX7PxwTiBlCnYGRP15J6rwiDlgRDy0dYw8mb4YwqlIbGrZiTkGJqFQ== 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=WR4r95AImEpVKDY27H8FWcKXZoDuUBWDqDRBgxdMk0w=; b=2loNNyYGMEzYL98NH+BIMgruMWbiV5tLdaXDNsQRsfRxMs4VXNCOoYM5af8YA87XXrCJL62iAm/gcLN7PU8Ncx+4Lpmu+Feh4OjF8UQ1qTnNZHirOsZxVmd0hAhUA+rEwhw8AQ9Fxx+O9t9aArRfJm6+TeNBcSxlHM7geq4WS3o= Received: from MW4PR03CA0083.namprd03.prod.outlook.com (2603:10b6:303:b6::28) by IA1PR12MB6355.namprd12.prod.outlook.com (2603:10b6:208:3e1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 21:46:56 +0000 Received: from CO1PEPF00001A63.namprd05.prod.outlook.com (2603:10b6:303:b6:cafe::c3) by MW4PR03CA0083.outlook.office365.com (2603:10b6:303:b6::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 21:46:56 +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:46:56 +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:46:54 -0600 Subject: [RFC v2 PATCH 1/7] x86/resctrl: Add multiple tasks to the resctrl group at once From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:46:54 -0600 Message-ID: <167537441417.647488.18261538242584692230.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 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_|IA1PR12MB6355:EE_ X-MS-Office365-Filtering-Correlation-Id: a13a78c9-2064-438e-ec87-08db05670159 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Q9bxvvJiXKj5uED9s/g9jIFYc5b/XXpXiXN9mJGHN9wOjfpkAlhpUT4Bpwx1+G8CAzKMVpKej2j2qDFUXvMaHTKBtJsC+7y7q7tUsPVapTLRIWUUGgu/Rhj8l7dZalKoeRz7hI3CRzCzeyjExO/YU9SDXAFXn/LlD9RuEmxWx8H8XMHW1ooEBr0hwJZnJq+NR2+Lfl5pgZp0t66TFGIBR1a9z8kbFVPNIsZ0v1SiNCgkg7vhp858EVKpCSx/DEAlFRSbSZB2vIY64mjxZMYpKOdSs+P3GmdxNPK5Jsw99THWOt4V7AgCVzMCJcIxNn/uvg+wX0Bg4F2AcF7vLTzs6eHwNb4iNyXu3A66cHTR8GCcR082vHNuOSZ9vu1VgKjBn/CdNteXJIIZZ34Z1LgONsCHVkrEzrRrq0dnxMUPPMHXpC0M9qfE5mEls2ZvucryglF5PqFzGwxianeffQxihYkbAe7aqBrVcOSp3hTDN6rB1FPVXadKQykq/lM57ddH8E4blxvlZPKl5MLE74MWZAgFkEQG9+6IPyZ7A6OSDMMPDZehlEjdBpLM1DDfGLfd5Wwly6fxrRn2FG4fcjvFyRqpDbWiV/C3KIYY3ov6WC2QXsLXb8e9w9OiXD3CmKAGLofaq9PnnWkbAWEgc99wZAE6RNgr0Xq5gmiVovEYnhtSYFmgyF0nuEr0KnKx211xUbZHrpagQiYCnbiozeimpAMGeBJ3pya9DleWIKtSIaLM3GlWtuV0gA9ftBQ0Xjx 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)(136003)(376002)(39860400002)(346002)(396003)(451199018)(46966006)(40470700004)(36840700001)(66899018)(5660300002)(86362001)(81166007)(356005)(70586007)(70206006)(40480700001)(103116003)(44832011)(7416002)(2906002)(8936002)(426003)(41300700001)(478600001)(33716001)(36860700001)(40460700003)(82740400003)(8676002)(83380400001)(336012)(26005)(9686003)(316002)(110136005)(16526019)(186003)(54906003)(16576012)(82310400005)(47076005)(4326008)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:46:56.3935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a13a78c9-2064-438e-ec87-08db05670159 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: IA1PR12MB6355 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757679235310379?= X-GMAIL-MSGID: =?utf-8?q?1756757679235310379?= The resctrl task assignment for MONITOR or CONTROL group needs to be done one at a time. For example: $mount -t resctrl resctrl /sys/fs/resctrl/ $mkdir /sys/fs/resctrl/clos1 $echo 123 > /sys/fs/resctrl/clos1/tasks $echo 456 > /sys/fs/resctrl/clos1/tasks $echo 789 > /sys/fs/resctrl/clos1/tasks This is not user-friendly when dealing with hundreds of tasks. Improve the user experience by supporting the multiple task assignment in one command with the tasks separated by commas. For example: $echo 123,456,789 > /sys/fs/resctrl/clos1/tasks Signed-off-by: Babu Moger --- Documentation/x86/resctrl.rst | 9 +++++++-- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 24 +++++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst index 058257dc56c8..58b76fc75cb7 100644 --- a/Documentation/x86/resctrl.rst +++ b/Documentation/x86/resctrl.rst @@ -292,13 +292,18 @@ All groups contain the following files: "tasks": Reading this file shows the list of all tasks that belong to this group. Writing a task id to the file will add a task to the - group. If the group is a CTRL_MON group the task is removed from + group. Multiple tasks can be assigned together in one command by + inputting the tasks separated by commas. Tasks will be assigned + sequentially in the order it is provided. Failure while assigning + the tasks will be aborted immediately and tasks next in the + sequence will not be assigned. Users may need to retry them again. + + If the group is a CTRL_MON group the task is removed from whichever previous CTRL_MON group owned the task and also from any MON group that owned the task. If the group is a MON group, then the task must already belong to the CTRL_MON parent of this group. The task is removed from any previous MON group. - "cpus": Reading this file shows a bitmask of the logical CPUs owned by this group. Writing a mask to this file will add and remove diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index e2c1599d1b37..13b7c5f3a27c 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -683,16 +683,34 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off) { struct rdtgroup *rdtgrp; + char *pid_str; int ret = 0; pid_t pid; - if (kstrtoint(strstrip(buf), 0, &pid) || pid < 0) + /* Valid input requires a trailing newline */ + if (nbytes == 0 || buf[nbytes - 1] != '\n') return -EINVAL; + + buf[nbytes - 1] = '\0'; + rdtgrp = rdtgroup_kn_lock_live(of->kn); if (!rdtgrp) { rdtgroup_kn_unlock(of->kn); return -ENOENT; } + +next: + if (!buf || buf[0] == '\0') + goto unlock; + + pid_str = strim(strsep(&buf, ",")); + + if (kstrtoint(pid_str, 0, &pid) || pid < 0) { + rdt_last_cmd_puts("Invalid pid value\n"); + ret = -EINVAL; + goto unlock; + } + rdt_last_cmd_clear(); if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED || @@ -703,6 +721,10 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of, } ret = rdtgroup_move_task(pid, rdtgrp, of); + if (ret) + goto unlock; + else + goto next; unlock: rdtgroup_kn_unlock(of->kn); From patchwork Thu Feb 2 21:47:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp490981wrn; Thu, 2 Feb 2023 13:50:23 -0800 (PST) X-Google-Smtp-Source: AK7set/wptpfKv/O+Ft+6C2IguM466bFHOBDhqYBkyRAP74l0jRma/VesKqCr827LuuB0i+iy82M X-Received: by 2002:a50:d0cc:0:b0:49d:6ebe:e9dc with SMTP id g12-20020a50d0cc000000b0049d6ebee9dcmr8610640edf.25.1675374622997; Thu, 02 Feb 2023 13:50:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374622; cv=pass; d=google.com; s=arc-20160816; b=snuJ0Lw5pmbywMf8fhqrXZ+sUDTJ7srZmhkHk4WQQRsvr9EBzYpW5w33Y5fcogFYuH Oi+bSZ+3OW64wmeQZH8Iz8KeJSGcjp9kLmLxwWWoUJsMrN2sDPVGlLjkXrimLhLmnHm5 lINOLhhDLw9rvl3RrXaxkuRnnzZXIF0HnQ6SKkKP5M9uxwit6NEV24hVq0SB7hEwSBN8 MYHIfgBPSyQbDV0Qjqz9kwdHOWOqfOhXrYzsHTkPITJZxeoLefGXm50KfskTEEuIOSsg kMso5rWtIE/tMSY/E2e+jMGrcd2PdnQOKlT4hbm9O/VCWenEkHDIRQZr+J+Mq0a+HwpU jlbw== 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=gBTajpA0WH7bgpLB6DtWgGNNgryYV5eQZMQu51zpt5Q=; b=lgocLXijaN33EkuJBJUE6VQHg7WiwN/OrJBRZiAHBGovcaSNY7qhpxtzyBe3xHfwQI UMUmBiUMqKVzBx54BekEQEG+ZtPQ9yBfnX1Hjeog1raKGuxsKkY+BhJUQz5XU6tgp987 551P2JxHmRgRnfJLA8TsQarh9G8XVzhWWXZmBpOfp0VRaDrmn6kaSZQ8C80D6s7a40lg M2IlKWozdNnH0UsjF6X7acmaIKGZwbxR8FTO3MIUoTpA81FI0hvfL6T07yxYt7K525sg acWuLwaB+IT2Voevw7vFg2cK4kE88d4347rC/8Hd5yIstwDq/yGrMQ10lgbmjfOh7CBD ulSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=OJQY0Rx5; 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 fd14-20020a056402388e00b004a21a65f8a8si599519edb.402.2023.02.02.13.49.58; Thu, 02 Feb 2023 13:50:22 -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=OJQY0Rx5; 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 S231862AbjBBVrV (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjBBVrT (ORCPT ); Thu, 2 Feb 2023 16:47:19 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2069.outbound.protection.outlook.com [40.107.92.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905EB8626C; Thu, 2 Feb 2023 13:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kGN7EAbVJNPLRV9stZy6ECmNrqQt/0HvwIueOlBC+hIzQNCGXejZ7XXz0+4f7rBngq8N6gK9oIbhO8RHaERJZuIbr3+TrIgvvJ5jtewRBsOXoqEqOe8JR2fY/cFkRzioEmiCKg04/LHuWLU1eYXeL1GS+SNE0fvfUCkmj0YM+3J+u+lpQXcRUgkGo8NmLxeHsDHb2KGUaHFKCqbxBz9mGhBkFYm+olaySXrO2htO5dQefJiJ7z4//ZFmSTDVgd4uGrUHtyKa7ZxnS1GoPhjvDlRM2HVrqoFCP+/3cfbmBZmVQKez+/wTWssRJrW02ilNJDJUy74Favv7NbR3+zDUtw== 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=gBTajpA0WH7bgpLB6DtWgGNNgryYV5eQZMQu51zpt5Q=; b=fhHV9gZXNOBRYcpfiNMzIoWuUm2sV54XdrvYXeURaPTdVMx4NAmI4dt6JR94t0Tr9jhSX3Y8bupnKGYsDR4JurOF87dA7BmUoHyW/T7m/2F9Sz+6+0nI3+G+dY2zk0wViPJA6SvYIWiV1mth1nB6Hr9dOJgFh9xkefn/BQXUG+0LhY1Mh9KpjPCzHUk2To2gniH9m/7/O8yv0/Qf9IrWSRERV6asfaEEXG6rGyiMaUXBnN4bMmqrBdmwMpqigqqrBtPWUWHLDR6dLjec9NdNoUCvizoIuDenBcv0ZWi/eGMElLXLHafjkD4d/45ZYc20axgjyb/Tep+0pPokW30SxA== 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=gBTajpA0WH7bgpLB6DtWgGNNgryYV5eQZMQu51zpt5Q=; b=OJQY0Rx5b2i+6LTBvv4rBtgu7Nn8XwVv4fQSaSUvgUxz7uU/laqLq1C8cRaH6UpedWfxVLxujdspq8INwC9BecgUg/MIbQgMXsnn/rtIJT7FW2GwMa4RbCLaClyRqxuckY/9JIBaXzMXwx3kdnhKIaveFlQd6cx1HbMQTBXRv2I= Received: from BYAPR03CA0032.namprd03.prod.outlook.com (2603:10b6:a02:a8::45) by CY8PR12MB7122.namprd12.prod.outlook.com (2603:10b6:930:61::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Thu, 2 Feb 2023 21:47:08 +0000 Received: from CO1PEPF00001A64.namprd05.prod.outlook.com (2603:10b6:a02:a8:cafe::56) by BYAPR03CA0032.outlook.office365.com (2603:10b6:a02:a8::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 21:47:08 +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 CO1PEPF00001A64.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 21:47:07 +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:06 -0600 Subject: [RFC v2 PATCH 2/7] x86/resctrl: Remove few unnecessary rftype flags From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:00 -0600 Message-ID: <167537442064.647488.11274211283317010424.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 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: CO1PEPF00001A64:EE_|CY8PR12MB7122:EE_ X-MS-Office365-Filtering-Correlation-Id: ae607a50-c2ed-486a-1bbf-08db05670834 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QFU9+XLh02dT1QRSDFnKL8fOYFlDvkUYtpRJinDQv2vq058r6lVcyKmpT66GdW9LZhYVquQ8jf7v2LrGKOc7yQA/Q+v3cS3cszY/aQGeDNHrCQ45kqViqYUec56m0imS4n6FwWxpNXO6WBOdJEWZ5KR04nH9CbKCrFnrhvNO0GqK4/A+dgFpkZsagb39QT5GSdTMi08XkJFEpuxp4cHSHzsVAR0pFQ7NZMKlXQ1XVVIxEM9n6uFcpB2cNcksTP1ns+tAl/T0US5RKmoTScGWX18yEzmI4ZvyISDS2OxHJdm+d02YGVRfKi0sm/1Wyh67xJCB6anmVVpfqSlXZ+K0X+d+/aEQ58GW5yl8aWN1MKBSIqBOCAhBUjk4IsAkGol3SW77vVyP9oFnMb4AggnO/QwHk2RGV67xJ0eiKxiNRqNTo6l7p3eOpha+WdkA7jS3CSex2SYAUFgTIERatYEvm8NDRZq9yYvsUJnD8w3DwhgxTmFALp0Mml3Lmoge9GfFIrd8LF2UrZRXFAqWfsNNWz7ddPIn4UWbPlGobxUdz0FEVQPYjctbBF1Uocz9wVSnPDY/yYE3AEYMfe+EQFaS0sUtZPaPIipvIS3nWYWcwqEdesQLQvk72repGEVBl2pbYuF3YQlbCvGOodpQtAn+JZ7fqftJb4nIrtmLuxjBxyO777AkLUqUYkg/k6iFnuhjOaSKGzPL/hCtzK9OGSqIDrJUydQ5kDONlBusKBU+h371Ju3x2xUE//4p3NTi4RUnEJ6ba/V8gL2fVFCRRIg1KA== 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)(4636009)(7916004)(376002)(39860400002)(136003)(346002)(396003)(451199018)(46966006)(36840700001)(40470700004)(103116003)(81166007)(86362001)(82310400005)(356005)(83380400001)(6666004)(186003)(82740400003)(36860700001)(33716001)(336012)(426003)(9686003)(47076005)(26005)(16526019)(44832011)(316002)(2906002)(478600001)(110136005)(54906003)(8676002)(40480700001)(70586007)(16576012)(4326008)(70206006)(7416002)(5660300002)(41300700001)(40460700003)(8936002)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:07.8897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae607a50-c2ed-486a-1bbf-08db05670834 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: CO1PEPF00001A64.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7122 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757620524321853?= X-GMAIL-MSGID: =?utf-8?q?1756757620524321853?= Remove few unnecessary rftype flags and simplify the code. This is done to further cleanup the code eventually. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/internal.h | 9 +++------ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 10 +++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 8edecc5763d8..571145d75d29 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -243,12 +243,9 @@ struct rdtgroup { */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1) -#define RF_CTRLSHIFT 4 -#define RF_MONSHIFT 5 -#define RF_TOPSHIFT 6 -#define RFTYPE_CTRL BIT(RF_CTRLSHIFT) -#define RFTYPE_MON BIT(RF_MONSHIFT) -#define RFTYPE_TOP BIT(RF_TOPSHIFT) +#define RFTYPE_CTRL BIT(4) +#define RFTYPE_MON BIT(5) +#define RFTYPE_TOP BIT(6) #define RFTYPE_RES_CACHE BIT(8) #define RFTYPE_RES_MB BIT(9) #define RF_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 13b7c5f3a27c..cccf3fb84b26 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -3163,7 +3163,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, { struct rdtgroup *prdtgrp, *rdtgrp; struct kernfs_node *kn; - uint files = 0; + uint fflags = 0; int ret; prdtgrp = rdtgroup_kn_lock_live(parent_kn); @@ -3215,8 +3215,12 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, goto out_destroy; } - files = RFTYPE_BASE | BIT(RF_CTRLSHIFT + rtype); - ret = rdtgroup_add_files(kn, files); + if (rtype == RDTCTRL_GROUP) + fflags = RFTYPE_BASE | RFTYPE_CTRL; + else + fflags = RFTYPE_BASE | RFTYPE_MON; + + ret = rdtgroup_add_files(kn, fflags); if (ret) { rdt_last_cmd_puts("kernfs fill error\n"); goto out_destroy; From patchwork Thu Feb 2 21:47:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491450wrn; Thu, 2 Feb 2023 13:51:41 -0800 (PST) X-Google-Smtp-Source: AK7set/F9Jhot8PdLAJXHadqIQigOKwrR0vldzr7QSMhvUKMo1SbHApbHUMixnBpAfYWIiUq59/n X-Received: by 2002:a17:90b:3e83:b0:230:3256:2ef3 with SMTP id rj3-20020a17090b3e8300b0023032562ef3mr8062491pjb.43.1675374701085; Thu, 02 Feb 2023 13:51:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374701; cv=pass; d=google.com; s=arc-20160816; b=e2PH+s2KqQ8h1i+xOFrtFL1eB6HP+eqMZ+XHilH4Eopbwi0aGokTQ+lJrasOsu6Rg/ ZQldGuVJ9GvuvS3NrbtFJ1JQVDmoyjQLuCa9ojD5kSoqVcMMuSuuZGIjNds9vVS1Zn5G ZaIA0ovrCr6pY+1nQ9LLjAsQEgWPLMj7NUD3TXtJ/zmDgq1jvent3ddPPr30CZhj5TOn 5E/u1SMSnXB91QjQ60MYOWeOVaxRXTkwl60oijzKqXFqTAa10GM2CMKSe/FI2lbmZxgc ndKdILxQBTYBnbdoNbv7Qbimo8lHoUJQBdWsUux2Qbsr0YXDQjHP8u1Hny+N5j5Q34+3 IWqQ== 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=1ovAuZpiTt1LtCVS4njkKI3b17HTdRLm1SUu+c4lkvo=; b=UtMF/EG0DTa7Kcd2AcS+wh8u9uQncXlS7STkBfc4AWxpBNK74rsWnQc9v7RmYqpnQQ fAWtj3ARDYuq0vPz6J9JbGIMtnJ41mDyQJCUEbjiWM4eJQCnYzdjYNrzT7nRtbPnsA0u xH2Z+XPKzb5TjRwXDK9NOshXx9yeDAC3IU6VU/fiAnlSHnQJ+GJaFCVm4xGYS5PTLZvq tHuUlMGuUmbD96Qc2GWa1jYzOARttcZi6R6Egalz48UsqUTCcWOC0P13fK9YYLGFn8uB /PZjuZ+EHshBCYPG23pSwHZT9itIMihKNuXSTm1f0DY7zLFty61cZej9ZUm7l9hf7as4 QpLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=nNUl5Jh9; 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 me14-20020a17090b17ce00b0022c216a776fsi1014769pjb.1.2023.02.02.13.51.28; Thu, 02 Feb 2023 13:51:41 -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=nNUl5Jh9; 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 S233038AbjBBVra (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjBBVr0 (ORCPT ); Thu, 2 Feb 2023 16:47:26 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2073.outbound.protection.outlook.com [40.107.220.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BCBF86615; Thu, 2 Feb 2023 13:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKFKqhaPmyEliPWHszF7EmlUiWTSMqRi9YrKNOqoWYo1Hrc1w4OMNlRV+D98I1lYDbRHQDOB8u3eIbL71sk2fKQjdFcZ4/TsP1qdzYyRf3rK1tQFXT62nwzmP+QLBdpah7m1ohBTYDuvbu38aVTMCKc0X5jYEB+iNY+IE/CXHkDY9Q2+NVWtzVhX4IqnZSuP8LOwhujmvwtd30Bi7DepOIz2yRKiiAdeSB91PQ8R1WC0es568+g5ifg1i7MsEb2FiehRFWmnj820MvpmTbq9F86jwvaCKEPJVMLqlPyjTFn4stQzWT9lxjZKnRgQwwEErwKHvhWICA3jNfqUtack1g== 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=1ovAuZpiTt1LtCVS4njkKI3b17HTdRLm1SUu+c4lkvo=; b=Zuht6BLAk13NPPdiAB0Tbym3GcAd/eWb/qkz5rboeWLqEBvD1DIo9IM/v+jKLZU1aG4OReg7cdCCPpEVVFR1joRvK45TptcYEANsxa9o4Tum/em5T8E/P8/RQmzQQrDf2L0GlkdE4nw4JuEYOPFUnzJHAyU4u1pEDCc99NYC0fGtaGE10jk84F2K/kzDyKsMc2DJ18tOCHlqSmL/hbGRgoVxMpg1NNn/wetsvgk/bGqscdU60KlwK6H/+ndxxAgvupZPUjwTdXakqwYJ0YAEDUhkwhO7Ot2vxPCFiD6f+4z+KKTi4BERKZ7qYAhEzqjEZnQ8rYnv4kQqgVLW1+Ebcw== 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=1ovAuZpiTt1LtCVS4njkKI3b17HTdRLm1SUu+c4lkvo=; b=nNUl5Jh9samnXi9aSO2ZtBhJlIptZ0Gyd4lCapvxmxiHqowuMZQT7FfjKpUSXrwV3z2FKy1nhaV3QBfkyojjfdjvQrDtCEsnibUrRst56ds+LC3Gml8IIKLKZKcvfbf/rohgueXBnDWQwBToHZFIvh2PCa1kZtUGEX7YYsn3HhI= Received: from MW2PR2101CA0007.namprd21.prod.outlook.com (2603:10b6:302:1::20) by DM8PR12MB5479.namprd12.prod.outlook.com (2603:10b6:8:38::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24; Thu, 2 Feb 2023 21:47:14 +0000 Received: from CO1PEPF00001A60.namprd05.prod.outlook.com (2603:10b6:302:1:cafe::64) by MW2PR2101CA0007.outlook.office365.com (2603:10b6:302:1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.7 via Frontend Transport; Thu, 2 Feb 2023 21:47:14 +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 CO1PEPF00001A60.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Thu, 2 Feb 2023 21:47:14 +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:12 -0600 Subject: [RFC v2 PATCH 3/7] x86/resctrl: Rename rftype flags for consistency From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:12 -0600 Message-ID: <167537443207.647488.2343865571652545811.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 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: CO1PEPF00001A60:EE_|DM8PR12MB5479:EE_ X-MS-Office365-Filtering-Correlation-Id: 40599279-a371-4446-dc3d-08db05670c09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lUH6fObmYkzPpjUlqdyHrEZfQ4YOEN068tMe46qu3LqZI2ZzFIA+jX7XHA13b4/IRNUKUsKKFRdj08C9Tz4Yf7GP5TTYOwiqGFvNmlv6Ggm83RMLDhoYjZncwwQYldbPd1P4h0gvIe8+Dgtb1mlE+pXDHQXWshqnjtT1r9BUbGWH9HZfjd8aYYyNWzWz4zYFunEo9zssXQylZIT/BBpH+C6ZchNTn4IPU2eYOEcwpvy2/Rupc7AGadBvRyo0hn7m5qtIweH93jfnb122m8na42rEpcYD73SZrSyfqkjhU5+3awNJYJMkaJsb8bWRH/9oDEFKHqPAWepfBxAsI0T/u93DfGK3d0S9umCZU4oqrp+OMqqFfZ7RlCPwKNgH6Gf2RyqUuGXD/fse9eWLRgH1lKVQTiYFPMhrtLJzEgCXO8hzc8y17w/58ysytee7eHpMPJroV4xBogIsnWCPa+wjfsOdODXNfRfv0KK10VQ1UqXV94CsohJKAPHoBgpbmkSuZXxCT50a4vm2oSYpCQ4MRy51d0j2dkSQ77KsGmioGff52N3MceplmACjRUgr4r0makV9YIKYIu+M9csXcdCXEVonIoR4qxnL5CHJM/o6SJAExanuGeT4SllndcZ3Y45nHLa1rIT/8IYPXcvXetfb6M9gmEBLUDTfFNoZn4T4vqUCiEj8WsnZP9n4Xd+5vqLsQguG+kLQNOrNcGG9B0O3V2pqjgNMGmPpW/uaarhbs6LF0dVJftKf1hSzDr7S1DWit18MAdTjo2HzUqNnreuKzw== 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)(396003)(346002)(376002)(39860400002)(136003)(451199018)(46966006)(40470700004)(36840700001)(47076005)(356005)(81166007)(82310400005)(103116003)(86362001)(40460700003)(40480700001)(36860700001)(82740400003)(33716001)(16576012)(44832011)(5660300002)(54906003)(110136005)(316002)(2906002)(4326008)(8676002)(41300700001)(70586007)(70206006)(7416002)(9686003)(16526019)(26005)(8936002)(83380400001)(336012)(478600001)(426003)(186003)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:14.3081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40599279-a371-4446-dc3d-08db05670c09 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: CO1PEPF00001A60.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5479 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757702956716942?= X-GMAIL-MSGID: =?utf-8?q?1756757702956716942?= The rftype flags have two different prefixes even though they are used for the same purpose. Change the prefix to RFTYPE_ for all the flags. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/internal.h | 8 +++--- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 42 ++++++++++++++++---------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 571145d75d29..2cfc3c431d5b 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -248,10 +248,10 @@ struct rdtgroup { #define RFTYPE_TOP BIT(6) #define RFTYPE_RES_CACHE BIT(8) #define RFTYPE_RES_MB BIT(9) -#define RF_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) -#define RF_MON_INFO (RFTYPE_INFO | RFTYPE_MON) -#define RF_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP) -#define RF_CTRL_BASE (RFTYPE_BASE | RFTYPE_CTRL) +#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) +#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON) +#define RFTYPE_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP) +#define RFTYPE_CTRL_BASE (RFTYPE_BASE | RFTYPE_CTRL) /* List of all resource groups */ extern struct list_head rdt_all_groups; diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index cccf3fb84b26..018a26b58154 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1691,77 +1691,77 @@ static struct rftype res_common_files[] = { .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_last_cmd_status_show, - .fflags = RF_TOP_INFO, + .fflags = RFTYPE_TOP_INFO, }, { .name = "num_closids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_closids_show, - .fflags = RF_CTRL_INFO, + .fflags = RFTYPE_CTRL_INFO, }, { .name = "mon_features", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_mon_features_show, - .fflags = RF_MON_INFO, + .fflags = RFTYPE_MON_INFO, }, { .name = "num_rmids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_rmids_show, - .fflags = RF_MON_INFO, + .fflags = RFTYPE_MON_INFO, }, { .name = "cbm_mask", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_default_ctrl_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, }, { .name = "min_cbm_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_cbm_bits_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, }, { .name = "shareable_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_shareable_bits_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, }, { .name = "bit_usage", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bit_usage_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, }, { .name = "min_bandwidth", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_bw_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, }, { .name = "bandwidth_gran", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bw_gran_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, }, { .name = "delay_linear", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_delay_linear_show, - .fflags = RF_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, }, /* * Platform specific which (if any) capabilities are provided by @@ -1780,7 +1780,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = max_threshold_occ_write, .seq_show = max_threshold_occ_show, - .fflags = RF_MON_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE, }, { .name = "mbm_total_bytes_config", @@ -1827,7 +1827,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_schemata_write, .seq_show = rdtgroup_schemata_show, - .fflags = RF_CTRL_BASE, + .fflags = RFTYPE_CTRL_BASE, }, { .name = "mode", @@ -1835,14 +1835,14 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_mode_write, .seq_show = rdtgroup_mode_show, - .fflags = RF_CTRL_BASE, + .fflags = RFTYPE_CTRL_BASE, }, { .name = "size", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdtgroup_size_show, - .fflags = RF_CTRL_BASE, + .fflags = RFTYPE_CTRL_BASE, }, }; @@ -1899,7 +1899,7 @@ void __init thread_throttle_mode_init(void) if (!rft) return; - rft->fflags = RF_CTRL_INFO | RFTYPE_RES_MB; + rft->fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB; } void __init mbm_config_rftype_init(const char *config) @@ -1908,7 +1908,7 @@ void __init mbm_config_rftype_init(const char *config) rft = rdtgroup_get_rftype_by_name(config); if (rft) - rft->fflags = RF_MON_INFO | RFTYPE_RES_CACHE; + rft->fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE; } /** @@ -2043,21 +2043,21 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) if (IS_ERR(kn_info)) return PTR_ERR(kn_info); - ret = rdtgroup_add_files(kn_info, RF_TOP_INFO); + ret = rdtgroup_add_files(kn_info, RFTYPE_TOP_INFO); if (ret) goto out_destroy; /* loop over enabled controls, these are all alloc_capable */ list_for_each_entry(s, &resctrl_schema_all, list) { r = s->res; - fflags = r->fflags | RF_CTRL_INFO; + fflags = r->fflags | RFTYPE_CTRL_INFO; ret = rdtgroup_mkdir_info_resdir(s, s->name, fflags); if (ret) goto out_destroy; } for_each_mon_capable_rdt_resource(r) { - fflags = r->fflags | RF_MON_INFO; + fflags = r->fflags | RFTYPE_MON_INFO; sprintf(name, "%s_MON", r->name); ret = rdtgroup_mkdir_info_resdir(r, name, fflags); if (ret) @@ -3554,7 +3554,7 @@ static int __init rdtgroup_setup_root(void) list_add(&rdtgroup_default.rdtgroup_list, &rdt_all_groups); - ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RF_CTRL_BASE); + ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RFTYPE_CTRL_BASE); if (ret) { kernfs_destroy_root(rdt_root); goto out; From patchwork Thu Feb 2 21:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491091wrn; Thu, 2 Feb 2023 13:50:45 -0800 (PST) X-Google-Smtp-Source: AK7set8/aWAZJJxyLSi70mh6D4x5jRj7JqpBr1ggUJVEQ5nkNtjwVOKZQjF6OYyZdNzTGM3atH5d X-Received: by 2002:a17:907:c282:b0:7bd:43e9:d3ab with SMTP id tk2-20020a170907c28200b007bd43e9d3abmr7213135ejc.52.1675374645451; Thu, 02 Feb 2023 13:50:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374645; cv=pass; d=google.com; s=arc-20160816; b=og2VjpAMtU/yL0E4n1Owzw6ur3oQxbTtgLowcUXDRe8jm0s8LO2V8qo64JXvTf2Hxl SkE7Abw4GoVHcoAXJ5VyitviSeu/W+74/Uyn8FdkVtghjcBJu+8JJNZB05a3vbpymdrn car7BE63gXDZIRb50QU6nAdBqbWiH4JClIKJ7LwEFGsgw6BTINcnwf1MWJgiarJt3AAD cjRLt6TXkgZuuDRb5bCft8pfac+CHxv6vPQXx/Nh21jAHeJ2Wqr6gJ0s+g+VYj8s9Emp fty5QfdJ8Q30TT1j5vJvoDfGoy0ik9cEzteoOWkLLLGZrKuPtsHSaYnNq71adkOL33yb Q2RQ== 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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=JiU20ilQn+RuRze4bDCmV/Gr8rtXFm0u1jn/EmFHts3CBerm+P+b6Z94lCTgI1VaGb zurznMRt0mNabgNzM3zoEbf6+fDdrC6jZ3G6chTTYSYniXOQ+x1rz3ywUmWLVbaI+eSI p6u4PWRgX/C8HBb3m0tG3OO9qrMfQC4nifgaMCOyb/mR4baRBzd3W+87HJX64KjZO3mu TZc/Sijy/dZvAK/zzK5JGbkfUPVcZZ5U1aTSfSd854URzZSY0uROKm73h/vxcyj/5OKK 1TEe1V5QBdTpfldM9bYOgyTzABeflXyWOG1camjMOo91meS8nNElVo2Dad3j+T1Kgho8 5+Ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="x7GXY/hJ"; 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 fd20-20020a1709072a1400b0087f0d8253d3si682849ejc.543.2023.02.02.13.50.21; Thu, 02 Feb 2023 13:50:45 -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="x7GXY/hJ"; 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 S231339AbjBBVro (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233046AbjBBVrk (ORCPT ); Thu, 2 Feb 2023 16:47:40 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2068.outbound.protection.outlook.com [40.107.101.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5097686255; Thu, 2 Feb 2023 13:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mncR11tgbfKFNANlf+TVIgr7WmgBdr2BKbJVa0lMrpNktfyNCkQ3d2zF95spYPx9cHUtc4vAOHbfqK91/tTkG1TQe8YCscokahbTA3xBcoSTyywV8miyynsodpL9IKd1SUh2DVQ4NDcMRn0R3X2oH+KGmeCwy4gxcmaRIWRf8jFfNQ+DgOpbdvsyZauQXnsBI99CeEnrpLfvaIxCmhGyVp8vYbBgA1FWyGB34B6sJAZlW2Z/eOKRQNjy3FPI5gncj793AQjYzaMaDsXXmE/dBnJvh1nuFaNMDcECao48/gBmA1DonBFUdzjjN+tHDkWeWMxDzd7g7MYTSebNBmsEYw== 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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=jNwwj41I3rMFrYuulGI9PWQj4n0ileSICUsmalDcvbR+KHv8PVDYExrWQYpqinRYYAj4cAu2ethDI80a335pPO7ha7frBFFEkHy7FrmkViIN1rCZBgiyXBo7sgvGLkj/G61W7RXJX0zhaDEfw4BZ2n4GlAOExnPM76Xd4S5WwVaOkgbVr8jRkHuzLq3DguzhW65A+uZTLDyryc8jxSYnPo9n0xgy2fx+59yfxX7er5hZepl0huXFdi6K8oaL04grgMlSC5byyHiOKWAlJOZ0piU3kyhJOUUU40SPacEcg+eV0lHIJVbm2LfwDP+u+9qAGQMHlIcDbpDQG7lneHdBMA== 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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=x7GXY/hJx58jFEC3+yq+hcRLXRPpdhzvxt/C6vVrL3+/xrbwMzlWHe3EIK2XXrWUMPpuGPYMoiounMQC/4/04bRIkwua6sFJRh5GiMUifSPiPnKAhpP7ufNo5WKvRbfmWtgWdT8L3SrW1lITi/xTlkLC9UhGSJRledHcjDx75TQ= Received: from BY5PR16CA0013.namprd16.prod.outlook.com (2603:10b6:a03:1a0::26) by MW4PR12MB7484.namprd12.prod.outlook.com (2603:10b6:303:212::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 21:47:21 +0000 Received: from CO1PEPF00001A5E.namprd05.prod.outlook.com (2603:10b6:a03:1a0:cafe::88) by BY5PR16CA0013.outlook.office365.com (2603:10b6:a03:1a0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 21:47:20 +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 CO1PEPF00001A5E.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 21:47:20 +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:19 -0600 Subject: [RFC v2 PATCH 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:18 -0600 Message-ID: <167537443852.647488.1158619967633364811.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 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: CO1PEPF00001A5E:EE_|MW4PR12MB7484:EE_ X-MS-Office365-Filtering-Correlation-Id: bfaeb5af-5729-4522-1f5d-08db05670fc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vecUbxAoJeBL57azhKk4h5NvhSyizgIBjOBR9GvLqot6tEhmUpmzFq6mFkP3WpuORJHntHFV3FrlWxeDsFQY6BN9SqZiCE+bGzOR++HUcwfawS8Lu0hqtF6z5WN9WhHiid+HQkY3SQ3hgC/rkN8gVkgYcDdTvDGeb3DzhZyXpsNDin2X1n/9PO9IIk4oRx1LqKeKDwGCdgBn0KRgh6uwB5S+mRDJlqNM92B0lTc2jsE94N8vpWyAj5T2zLSx0NF5XOVFW2MlC+BQJk7engQh/hDjhTc6PvoYnFEFEqmAP04ljVkD8Ga6GvF6uv3epnXb/yvE60N/I5DH820+lffmVkWBeA+1lE/oalC/xq4TgmdmAAgvUf5GYA+zlHE630RJe30StM62gOnm+63CHBpjDfZDCbriAJoTiHPSoK17BbrbmmyPofYlv03727vPUC+Av7PnT7nZR/K7mKtpa30Um95URe+tvpWT/gaX5EktzFAYMkWE7/K8ny8qrBrFk6lfpOz9ToTb6tgzmSdF6TEDturAA5tVICUQMrdhorcYo/zk6TcNiqiSWabt0iznsfBUNHf2ex6FYKXTvm9rtzZSYbob2cndEnRAPng/WmA5LdJI6hNIprDeGZRUkM2kGN00uEEQrlJSMDN02ESqQgUXJqU0JX4WTY0nTcausDWu6Pes/7A6nQxIkMLVaG12pqWui01bddiZDb+KcmlZ8nmkUeM6ImdpIvoi4WDP9XudfpEoMUgcgleGhWkbHlwuTHJ25/ow5CU+yA3ECUWySHlxQQ== 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)(4636009)(7916004)(376002)(39860400002)(346002)(396003)(136003)(451199018)(40470700004)(46966006)(36840700001)(82740400003)(426003)(44832011)(40460700003)(8936002)(478600001)(336012)(83380400001)(33716001)(186003)(26005)(103116003)(16526019)(70586007)(110136005)(4326008)(7416002)(316002)(41300700001)(16576012)(8676002)(70206006)(2906002)(5660300002)(9686003)(54906003)(86362001)(40480700001)(47076005)(82310400005)(36860700001)(356005)(81166007)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:20.6103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfaeb5af-5729-4522-1f5d-08db05670fc9 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: CO1PEPF00001A5E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7484 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757644029549627?= X-GMAIL-MSGID: =?utf-8?q?1756757644029549627?= RESCTRL filesystem has two main components: a. info (Details on resources and monitoring) b. base (Details on CONTROL and MON groups) The rftype flags can be renamed accordingly for better understanding. For example: RFTYPE_INFO : Files with these flags go in info directory RFTYPE_INFO_MON : Files with these flags go in info/L3_MON RFTYPE_BASE : Files with these flags go in group's(control or mon) base directory RFTYPE_BASE_CTRL: Files with these flags go in only CONTROL groups Add comments to make it easy for future additions. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/core.c | 8 ++-- arch/x86/kernel/cpu/resctrl/internal.h | 64 ++++++++++++++++++++++++++++---- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 42 +++++++++++---------- 3 files changed, 80 insertions(+), 34 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 030d3b409768..d1c6b2cc8611 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -69,7 +69,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_L3), .parse_ctrlval = parse_cbm, .format_str = "%d=%0*x", - .fflags = RFTYPE_RES_CACHE, + .fflags = RFTYPE_CACHE, }, .msr_base = MSR_IA32_L3_CBM_BASE, .msr_update = cat_wrmsr, @@ -83,7 +83,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_L2), .parse_ctrlval = parse_cbm, .format_str = "%d=%0*x", - .fflags = RFTYPE_RES_CACHE, + .fflags = RFTYPE_CACHE, }, .msr_base = MSR_IA32_L2_CBM_BASE, .msr_update = cat_wrmsr, @@ -97,7 +97,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_MBA), .parse_ctrlval = parse_bw, .format_str = "%d=%*u", - .fflags = RFTYPE_RES_MB, + .fflags = RFTYPE_MB, }, }, [RDT_RESOURCE_SMBA] = @@ -109,7 +109,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_SMBA), .parse_ctrlval = parse_bw, .format_str = "%d=%*u", - .fflags = RFTYPE_RES_MB, + .fflags = RFTYPE_MB, }, }, }; diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 2cfc3c431d5b..6767c85b9699 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -240,18 +240,64 @@ struct rdtgroup { /* * Define the file type flags for base and info directories. + * + * RESCTRL filesystem has two main components + * a. info + * b. base. + * + * /sys/fs/resctrl/ + * | + * --> info (Displays information about control and monitoring) + * | + * --> base (Displays the details on resctrl groups) + * + * ------------------------------------------------------------- + * info directory structure + * --> INFO + * --> TOP + * last_cmd_status + * + * --> MON + * --> (L2_MON) + * --> (L3_MON) + * max_threshold_occupancy, mbm_local_bytes_config, + * mbm_total_bytes_config, mon_features, num_rmids + * + * --> RES + * --> CACHE (L2, L3) + * bit_usage, cbm_mask, min_cbm_bits, num_closids, + * shareable_bits + * + * --> MB (MB, SMBA) + * bandwidth_gran, delay_linear, min_bandwidth, + * num_closids + * + * group structure + * ----------------------------------------------------------- + * --> BASE (Files common for both MON and CTRL groups) + * cpus, cpus_list, tasks + * + * --> CTRL (Files only for CTRL group) + * mode, schemata, size + * */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1) -#define RFTYPE_CTRL BIT(4) -#define RFTYPE_MON BIT(5) -#define RFTYPE_TOP BIT(6) -#define RFTYPE_RES_CACHE BIT(8) -#define RFTYPE_RES_MB BIT(9) -#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) -#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON) -#define RFTYPE_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP) -#define RFTYPE_CTRL_BASE (RFTYPE_BASE | RFTYPE_CTRL) + +#define RFTYPE_TOP BIT(2) +#define RFTYPE_MON BIT(3) +#define RFTYPE_RES BIT(4) + +#define RFTYPE_CACHE BIT(5) +#define RFTYPE_MB BIT(6) + +#define RFTYPE_CTRL BIT(8) + +#define RFTYPE_INFO_TOP (RFTYPE_INFO | RFTYPE_TOP) +#define RFTYPE_INFO_MON (RFTYPE_INFO | RFTYPE_MON) +#define RFTYPE_INFO_RES (RFTYPE_INFO | RFTYPE_RES) + +#define RFTYPE_BASE_CTRL (RFTYPE_BASE | RFTYPE_CTRL) /* List of all resource groups */ extern struct list_head rdt_all_groups; diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 018a26b58154..18d458a3cba6 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1691,77 +1691,77 @@ static struct rftype res_common_files[] = { .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_last_cmd_status_show, - .fflags = RFTYPE_TOP_INFO, + .fflags = RFTYPE_INFO_TOP, }, { .name = "num_closids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_closids_show, - .fflags = RFTYPE_CTRL_INFO, + .fflags = RFTYPE_INFO_RES, }, { .name = "mon_features", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_mon_features_show, - .fflags = RFTYPE_MON_INFO, + .fflags = RFTYPE_INFO_MON, }, { .name = "num_rmids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_rmids_show, - .fflags = RFTYPE_MON_INFO, + .fflags = RFTYPE_INFO_MON, }, { .name = "cbm_mask", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_default_ctrl_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "min_cbm_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_cbm_bits_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "shareable_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_shareable_bits_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "bit_usage", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bit_usage_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "min_bandwidth", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_bw_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, { .name = "bandwidth_gran", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bw_gran_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, { .name = "delay_linear", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_delay_linear_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, /* * Platform specific which (if any) capabilities are provided by @@ -1780,7 +1780,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = max_threshold_occ_write, .seq_show = max_threshold_occ_show, - .fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_MON | RFTYPE_CACHE, }, { .name = "mbm_total_bytes_config", @@ -1827,7 +1827,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_schemata_write, .seq_show = rdtgroup_schemata_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, { .name = "mode", @@ -1835,14 +1835,14 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_mode_write, .seq_show = rdtgroup_mode_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, { .name = "size", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdtgroup_size_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, }; @@ -1899,7 +1899,7 @@ void __init thread_throttle_mode_init(void) if (!rft) return; - rft->fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB; + rft->fflags = RFTYPE_INFO_RES | RFTYPE_MB; } void __init mbm_config_rftype_init(const char *config) @@ -1908,7 +1908,7 @@ void __init mbm_config_rftype_init(const char *config) rft = rdtgroup_get_rftype_by_name(config); if (rft) - rft->fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE; + rft->fflags = RFTYPE_INFO_MON | RFTYPE_CACHE; } /** @@ -2043,21 +2043,21 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) if (IS_ERR(kn_info)) return PTR_ERR(kn_info); - ret = rdtgroup_add_files(kn_info, RFTYPE_TOP_INFO); + ret = rdtgroup_add_files(kn_info, RFTYPE_INFO_TOP); if (ret) goto out_destroy; /* loop over enabled controls, these are all alloc_capable */ list_for_each_entry(s, &resctrl_schema_all, list) { r = s->res; - fflags = r->fflags | RFTYPE_CTRL_INFO; + fflags = r->fflags | RFTYPE_INFO_RES; ret = rdtgroup_mkdir_info_resdir(s, s->name, fflags); if (ret) goto out_destroy; } for_each_mon_capable_rdt_resource(r) { - fflags = r->fflags | RFTYPE_MON_INFO; + fflags = r->fflags | RFTYPE_INFO_MON; sprintf(name, "%s_MON", r->name); ret = rdtgroup_mkdir_info_resdir(r, name, fflags); if (ret) @@ -3554,7 +3554,7 @@ static int __init rdtgroup_setup_root(void) list_add(&rdtgroup_default.rdtgroup_list, &rdt_all_groups); - ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RFTYPE_CTRL_BASE); + ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RFTYPE_BASE_CTRL); if (ret) { kernfs_destroy_root(rdt_root); goto out; From patchwork Thu Feb 2 21:47:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52177 Return-Path: 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 + 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 ); 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 To: , CC: , , , , , , , , , , , 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 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: 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?= Add -o debug option to mount resctrl filesystem in debug mode. Debug option adds the files for debug purposes. Signed-off-by: Babu Moger --- 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"); + return 0; } From patchwork Thu Feb 2 21:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491804wrn; Thu, 2 Feb 2023 13:52:34 -0800 (PST) X-Google-Smtp-Source: AK7set/sgX2q+TL4JVPSpNsw5Sl3JLm2UV2pQ4Q0jMnXul+3bsBsC/ftaigjr4YwcXB5Asrh4O86 X-Received: by 2002:a05:6a00:b8c:b0:592:5885:8634 with SMTP id g12-20020a056a000b8c00b0059258858634mr7168524pfj.14.1675374754504; Thu, 02 Feb 2023 13:52:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374754; cv=pass; d=google.com; s=arc-20160816; b=OG5d+wDVTJ81diWr0ZO2ecweVQ4YVe2JHeWgYHosvrhlWdgEvSpLbe5IVqSBwY8QyW UksjezpnbzODQ4N0M2Gt6Uiazi0Vi7wrdDGXPLnci4lJ1Sao/GfRWvSJ518uEKyJBlpp NlnTC8zsmddBFVewZGEAsPTlFIeb0u7edJEy5FUc0U7OGRcZCZdiSBsNAuw26vrgiufd hyPtZRX/6CISFyb8P1K3J4NmmNpr7wFwNG3yBP2BU/oDDkmrmXnjA1eYN88IDNQB89Zz m71+VuC0nFi66fdu6DlDyLyebm5rOWUnk+EKONfSz1AGGka96nA1pvqLkI7SSJo0Kggv KzPQ== 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=0smFb+avJ9Wx8MwUlb3vlWOOpjCo4cU5/TxwWHUvKKU=; b=TF9Ivxz9LLssroOgOvot4zygm5N7dGTO+bWQXPzYqikVLhbqUfsgz12KoOi0XVHSIm jmQmCmPFJBiINklgDCtFl0UPeCsDXkqqQOHnylhoUmwFQfKNrjdGRXIqN+jwiwwxZKQw vhEus3eYK7Hf7yWFUB3ivIgAhckVywy0HfMZZDgVktKBoN2mBAUTzNMUoP1+mAEriWWT 4wfx+r8c/m58g6Adtfu2uwjMpe27aRC40AEu17b6m6AzJe71KEoVj9LaBjG4JAKfW1BX I1r5xnfKhkKDhUDTFHhznj2iiVcv0U1svn02x1cRL1+Rfex6YMWubiAM/DtuvAsOVjK9 MsuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ALeSD0xR; 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 cp8-20020a056a00348800b0058ba826a404si567634pfb.24.2023.02.02.13.52.21; Thu, 02 Feb 2023 13:52:34 -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=ALeSD0xR; 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 S233146AbjBBVr7 (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbjBBVrn (ORCPT ); Thu, 2 Feb 2023 16:47:43 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2084.outbound.protection.outlook.com [40.107.237.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DF78627D; Thu, 2 Feb 2023 13:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ENRfhL+H6Loax3Y7mMO1QQlXqFEZ7bgmpOP/lZsYbBNtl3WNNjjq0Cx/3Ajinu8jh5oIVIqSfL5o+vOEcKZgt1kEk/4tAhSi4Zc3M6bwGemARcKmSiB/d/+LflAvNCPHS3zCa6ntf73cOWNUEdwUUgMv4qTIa9sDt99QHNUrYQ2OwEYDB6c1eOeFdCLUs2BPqwxW2bazODV/3lwiVVyWcVDRNq85CfrYflQ6t567KdxzfTpmpu3kbOk9G+9MmLbyYx/zex2HmbUVFufYBmudjDhRMvP6C/k1fZpqlYKICF37enLjK7DFZ+Ped/1hKjRT/wrlooouOQGZEXmWUMLN0w== 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=0smFb+avJ9Wx8MwUlb3vlWOOpjCo4cU5/TxwWHUvKKU=; b=SO92bjjO9/tcZ4ZQVVoK0Fv+hA1oN4oTnwqP3waZrEkdY0n3tkDQqtjRGf9PG/1xwPjJA6raslJ5/g4/9pa/n37iLe2FpfLj5U+h6AjUwpz8Ac+3q5vfUfAuyDvOkesF3LS2i/8K59XCIZzgRh+n/gAKxzfYTKyNWrxnVvPw53Qu57VFq7CRWY5LuoG4MSzFqbKNrqLObms43t5wr4sjrOmbi/4WvpclieOsrn0L+QqdExye0Zv4XtaARAfHL7KAuntOnGS+YslPX7y486VTGO4PH3Bp2MW8/paE88ohi5I30AAf90dFYYnXNmWLpZT93eKpHqBGKX75DzthSx1glA== 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=0smFb+avJ9Wx8MwUlb3vlWOOpjCo4cU5/TxwWHUvKKU=; b=ALeSD0xRoaohhiNwy7yIUuXH8vCuvm2ZK9iv+Ms3x/5wIKQHosrvrKn0N9QhsfRhvOQ4iYqr6nKA+Z62IoJcswuEO0kKN26BO0KFPEc+/c4wowFkiP8sE3Fey6WGOQ/qMK4D7Utkedm2frCStmc8/4okqGbXtQV0elLrZh9oXRQ= Received: from MW2PR2101CA0007.namprd21.prod.outlook.com (2603:10b6:302:1::20) by MN0PR12MB5932.namprd12.prod.outlook.com (2603:10b6:208:37f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 21:47:33 +0000 Received: from CO1PEPF00001A60.namprd05.prod.outlook.com (2603:10b6:302:1:cafe::a0) by MW2PR2101CA0007.outlook.office365.com (2603:10b6:302:1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.7 via Frontend Transport; Thu, 2 Feb 2023 21:47:33 +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 CO1PEPF00001A60.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Thu, 2 Feb 2023 21:47:33 +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:31 -0600 Subject: [RFC v2 PATCH 6/7] x86/resctrl: Display the RMID and COSID for resctrl groups From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:31 -0600 Message-ID: <167537445137.647488.9039585071837467840.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 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: CO1PEPF00001A60:EE_|MN0PR12MB5932:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ab6f7a6-91ef-40a5-60e3-08db0567178a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NPnuE0iPcCQTEWwTgu+oy4Jh+5Sa6R+vafp6fkgkdPdDZZgwAgjbDsBcmX2Ltuf9ke46yyPExxLcx86Gx3R0vlRYMMBjDjOVZ4c7ShpZ3rJmrhb0ywOcaRaauNs+fybIExHQ6Jjz4MTo6bsj3Tg5Y2/tl6QPd6PCnb1obdxQKeptaR71mTGVYX2t0fr5ZrmGq2cyY6rzfyCSN4PyT4c79HIUXMIaupTb9JMpam3EHbbpoUqsuZVKfXxSlEtWE5WgyyOewkp4z/PVTwdefj6MWlae/AROcWvdNCzZ+0f9x+3Ujm2LmyGYNjHkktcIq4n+AZb8sub2x4iYMzh0FDrSLOAPr+N+TBxtq4Ie7Y9OzJA/W6p70F7mHrQ4jJ+JyL8rG/+wvohYwPwr5eYw7+Xw3z2JzNU0Z+P5ZBZplS6NCxM7nco39Y/Tq4l8s32GBf3b0dVGhIeHFGqtjOdyit/yj4ps/ZcwSesLCVAGkle7Oda6XdOI0kxxW8YIedPYtFUJS3JAdtH6HTrkDk+FMmkFVSAQoCguNWM7/qn+Fn880/Vi9Wf+Dnnjn8CgM0CnNG/WlBph35qHhx+wB/jUvUlpD+ddAQiL+c0+W7/jI0dwjbYzA+9+g8+Pr2d5LDtp87JDWdytF7ZL6hlB3rSCDGa1ArFEIDYJ8xXqvOOIrTJjXaE5LwDtuWRgcPy60tzOpfn4hp0rRx+K8CmgOHMnknYJQ7u/rN3Y3rxBpYAW2OYlxfDYDX3tyNMkuR3hSI39ofSuAcwJpzOdUW2DnYXrFSN1FQ== 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)(396003)(136003)(346002)(39860400002)(376002)(451199018)(46966006)(36840700001)(40470700004)(356005)(40480700001)(36860700001)(47076005)(82310400005)(81166007)(40460700003)(82740400003)(44832011)(426003)(2906002)(8676002)(41300700001)(7416002)(4326008)(16576012)(54906003)(70586007)(316002)(110136005)(8936002)(70206006)(5660300002)(86362001)(26005)(16526019)(9686003)(186003)(478600001)(103116003)(33716001)(83380400001)(336012)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:33.6053 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ab6f7a6-91ef-40a5-60e3-08db0567178a 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: CO1PEPF00001A60.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5932 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757758572338841?= X-GMAIL-MSGID: =?utf-8?q?1756757758572338841?= When a user creates a control or monitor group, the CLOSID or RMID are not visible to the user. These are architecturally defined entities. There is no harm in displaying these in resctrl groups. Sometimes it can help to debug the issues. Add CLOSID and RMID to the control/monitor groups display in resctrl interface. $cat /sys/fs/resctrl/clos1/closid 1 $cat /sys/fs/resctrl/mon_groups/mon1/rmid 3 Signed-off-by: Babu Moger --- Documentation/x86/resctrl.rst | 17 ++++++++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst index 2c013c5d45fd..de332c242523 100644 --- a/Documentation/x86/resctrl.rst +++ b/Documentation/x86/resctrl.rst @@ -321,6 +321,15 @@ All groups contain the following files: Just like "cpus", only using ranges of CPUs instead of bitmasks. +"rmid": + Available only with debug option.Reading this file shows the + resource monitoring id (RMID) for monitoring the resource + utilization. Monitoring is performed by tagging each core(or + thread) or process via a Resource Monitoring ID (RMID). Kernel + assigns a new RMID when a group is created depending on the + available RMIDs. Multiple cores(or threads) or processes can + share a same RMID in a resctrl domain. + When control is enabled all CTRL_MON groups will also contain: "schemata": @@ -342,6 +351,14 @@ When control is enabled all CTRL_MON groups will also contain: file. On successful pseudo-locked region creation the mode will automatically change to "pseudo-locked". +"closid": + Available only with debug option. Reading this file shows the + Class of Service (CLOS) id which acts as a resource control tag + on which the resources can be throttled. Kernel assigns a new + CLOSID a control group is created depending on the available + CLOSIDs. Multiple cores(or threads) or processes can share a + same CLOSID in a resctrl domain. + When monitoring is enabled all MON groups will also contain: "mon_data": diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 9b7813aa6baf..c35d91b04de6 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -760,6 +760,38 @@ static int rdtgroup_tasks_show(struct kernfs_open_file *of, return ret; } +static int rdtgroup_closid_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->closid); + else + ret = -ENOENT; + rdtgroup_kn_unlock(of->kn); + + 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 /* @@ -1844,6 +1876,18 @@ static struct rftype res_common_files[] = { .seq_show = rdtgroup_size_show, .fflags = RFTYPE_BASE_CTRL, }, + { + .name = "closid", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdtgroup_closid_show, + }, + { + .name = "rmid", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdtgroup_rmid_show, + }, }; From patchwork Thu Feb 2 21:47:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52182 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp492071wrn; Thu, 2 Feb 2023 13:53:23 -0800 (PST) X-Google-Smtp-Source: AK7set8m9h3XRZ4O8N94LqdRY7ADJVr7x7oRHXTsjK3mjsl8vJNDcGzQUJcqwy2T1OXE3h5QQCjv X-Received: by 2002:a17:902:d509:b0:198:9e29:cc5c with SMTP id b9-20020a170902d50900b001989e29cc5cmr8459643plg.22.1675374803426; Thu, 02 Feb 2023 13:53:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374803; cv=pass; d=google.com; s=arc-20160816; b=efBLH45ybtPV23dsZJS9hvTbwpWG/TJWQyd05ojcIbl1/iBv0SwoTUo08qABmtDWrJ OXHVsrrajXeDVg5cZVBdInL8M01jhMY2kSnnPygxWRqypBXLPVLyhya+op3g3OOMZOwy DwxBBQLNwTGIln5oGsnKbOdHH+3IV1+wC4BtR03DdnM7yUERSo6VkPovw6ctwfujfoXW otbtOPTi8ZWJge0T81SKWLDqcsDeAR/V61XvaRxbiIi4Ur7qCWpxN6fmpBs64VDiQQ7T VXqNL/ETrjt1pJhj+Y4pvv8Td/LeGenw1/1wvmF8kCBlUeJloSuunT4h3P2GmdRz30S/ S8Rg== 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=5lbQnT64KQPvkuOiU+KLSzU7ho039kXH4xuvrICmMgc=; b=p0zu67S1tamSeC12ppDZsIRoaL98/GJ0KNmYhOQ6uiXeriVTmvcnB0yfqKnQ7k28N/ 2zBhIr0YgChye86hcqZn2TxBfNzR8QE38Es54kuVlHCXVUhOPH1HAN5MZfdcS/6hT4/N hNrvaZPkhjhLSAEV9fsVV0f5g5GTmES6tdTsCC+wPM7m1uCOJhTGAl5BJy/98cj5Ra7Q HVqIrXgVRZxs3R82uVRFeqcAoVc2/4JR3iPr0XXIp6hHSfu/Vbf4PAXt5W5n724YbWoO U8gG/6aDnP7yGBarZu17yfExDJFY62o+s4Hqno9SRbuI/SOk3RaBuqAWJlFB3+VmcbWB YFjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tErftWnY; 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 w3-20020a639343000000b004d378558f31si667669pgm.136.2023.02.02.13.53.07; Thu, 02 Feb 2023 13:53:23 -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=tErftWnY; 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 S231744AbjBBVsJ (ORCPT + 99 others); Thu, 2 Feb 2023 16:48:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbjBBVrs (ORCPT ); Thu, 2 Feb 2023 16:47:48 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5366A313; Thu, 2 Feb 2023 13:47:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HDMAh42Vp6xpjchYl/prMtl9S2d1bU6nNOcAjIenKP06kh7iqD0X8uABLnUBOz3S1o91GLutYxLL2EM3nk+ayM9PX7EBPCrIEN44EGR6eVZ/wxaJb0xMgqhTMRMWv2fqffQB66+njPrO/FA8pVs9/kQKvHfWHa+9J2sZvznPUT7NE81kfG01scOYh6nYkD96nDLZNFC5/Et5Ki3QGR/bQo2o22CMsvWcWfo603LXcP7czfGekqluQXviftfHqDYNPwc2noCHVfSWhrIkC892yvuRQiI+IpeIaC4/2t3aT3kekB0/Xy+4giNCCnFBe7ZXp4couhV8DSe5E1qiHZhuuA== 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=5lbQnT64KQPvkuOiU+KLSzU7ho039kXH4xuvrICmMgc=; b=af0xT8JQaunrZGFcDI8VlW8uyKj8GbMCg/dnEfjj4f1piaaCMEF6aSZwgjGV9MXd+X5kcqtOoiqZFhq6S89T3JNXTygWxDXEHjVOOT1V6TYqKqwwS/a+lwdHoCdMqJ5KyNgzeAR1JEB0XYEyxWBI+Uha0dNT7sYW8vwytA4gBkQwk1D/ShDie+E6gbSEYUQX4zIT2r15E4i3HTo+4pY+I5lPOj7wneCaQcDQXd6NsAH+b97d+etgeVmNBdDWDpd9j3Z2vFilB5BcPKnRVkQ0JcNWdp7kXG9cF5KRkIyUYk7bjnhxa3s8+OgZwBb9ENllEivZZ0ikp4GBSpcN2avSGA== 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=5lbQnT64KQPvkuOiU+KLSzU7ho039kXH4xuvrICmMgc=; b=tErftWnYaNo060vGkCtXViR+ThnokInVwUl4T/k7fR0TRGo2Ca1LSKB5oIAqsuTINYMfoIT+ER9GfyNJ4vXDdBm53QBCBywFOYkd0SeRft+7DcvqiMEt2yh2p7L8CemzECTtRL2ykPql2L4H95H1qfFP1HN96+oL48rGIkarDHY= Received: from MW2PR2101CA0013.namprd21.prod.outlook.com (2603:10b6:302:1::26) by PH8PR12MB6891.namprd12.prod.outlook.com (2603:10b6:510:1cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25; Thu, 2 Feb 2023 21:47:40 +0000 Received: from CO1PEPF00001A60.namprd05.prod.outlook.com (2603:10b6:302:1:cafe::6e) by MW2PR2101CA0013.outlook.office365.com (2603:10b6:302:1::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.4 via Frontend Transport; Thu, 2 Feb 2023 21:47:40 +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 CO1PEPF00001A60.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Thu, 2 Feb 2023 21:47:39 +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:38 -0600 Subject: [RFC v2 PATCH 7/7] x86/resctrl: Add debug files when mounted with debug option From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:37 -0600 Message-ID: <167537445777.647488.12333202522131465679.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 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: CO1PEPF00001A60:EE_|PH8PR12MB6891:EE_ X-MS-Office365-Filtering-Correlation-Id: ddb0c058-55f1-4fde-c252-08db05671b54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yoR4CUaAHVQELfevWWeOF1Z6bU0t9UAL0t/66a4wQjU5lLUwfpfZA0ii6sdF/RR8bIipUVDnGCwVm8kmOPzfh54z99nI88qWO1agZRvZO5etzlG3VOspdUMvosK0zQLz5YYGOYgcGAqOxAOblLAJ1vP3gdehBH2s8dkkqP/0sS+CnyA5imzfrO8Qc74lcKChZb2YXZZDn0CaxMl2h34leJyHdte0DbA++R9eLus5GINZX0HqNkVYnv0ub1ZbOa872anHdEvmwlJmDM23iwmvLfjPG4rFhWAfaPUUvID4715KrAaLv6ikFTwsK1Qkh2ScADGNieL3BHEd800CsjPQnxwMyEzsDeLanzA5Bl0cqZ9FVm7cFsNyBRlQQRPPKCPNetUXkf57/wGFwfFVy4c/Dlzh3GGlBm7IIda3xOrkbp5yrLC1OKA2XBoHjhsxR5/GvpgKD9apr+1g0y5SJMb8JayXzu9ZfTDQziWeD1nIoPfpaJZkFnf7R3228ysiUtC9hsshBePx7yarwuk2WnZGhXm+kVNR7dyrzHWR6ZllE21b9jnm+xcwjCi+yOtz5O9xVRB3JiRIyWE9T4t59cay5IsV2r5Rl7e3QI2eUrDvykSPlCerVlj1mLbhPpbaUzFgIxGFTTfM93zrbdN+bmeXfpsk2tZQZl5ZsCfHb8hUwFtE2W77fhTHqzyON/7Y3A16YvKm9FHWxfkSFZ+pKrJKcS4T+xzuo7P2P1xKHOLesG21g6IH7llO3AAy2U6DizTG 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)(4636009)(7916004)(346002)(39860400002)(396003)(136003)(376002)(451199018)(36840700001)(40470700004)(46966006)(83380400001)(26005)(82740400003)(103116003)(40460700003)(81166007)(86362001)(40480700001)(36860700001)(336012)(186003)(82310400005)(426003)(356005)(33716001)(47076005)(9686003)(16526019)(478600001)(316002)(54906003)(16576012)(110136005)(70586007)(41300700001)(5660300002)(4326008)(8936002)(7416002)(2906002)(44832011)(8676002)(70206006)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:39.9960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddb0c058-55f1-4fde-c252-08db05671b54 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: CO1PEPF00001A60.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6891 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756757809554916908?= X-GMAIL-MSGID: =?utf-8?q?1756757809554916908?= Add the debug files to the resctrl hierarchy. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index c35d91b04de6..b7c72b011264 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2398,6 +2398,31 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn, struct rdtgroup *prgrp, struct kernfs_node **mon_data_kn); +void resctrl_add_debug_file(struct kernfs_node *parent_kn, + const char *config, unsigned long fflags, + bool debug) +{ + struct rftype *rft; + + rft = rdtgroup_get_rftype_by_name(config); + if (debug && rft) { + rft->fflags |= fflags; + rdtgroup_add_file(parent_kn, rft); + } else if (rft) { + rft->fflags &= ~fflags; + kernfs_remove_by_name(parent_kn, config); + } +} + +static void resctrl_add_debug_files(bool debug) +{ + resctrl_add_debug_file(rdtgroup_default.kn, "rmid", + RFTYPE_BASE, debug); + resctrl_add_debug_file(rdtgroup_default.kn, "closid", + RFTYPE_BASE_CTRL, debug); + kernfs_activate(rdtgroup_default.kn); +} + static int rdt_enable_ctx(struct rdt_fs_context *ctx) { int ret = 0; @@ -2411,6 +2436,8 @@ static int rdt_enable_ctx(struct rdt_fs_context *ctx) if (!ret && ctx->enable_mba_mbps) ret = set_mba_sc(true); + resctrl_add_debug_files(ctx->debug); + return ret; }