From patchwork Tue Oct 17 12:17:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 154223 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4091204vqb; Tue, 17 Oct 2023 05:18:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo17w4VUD+Ud/eNMC3P/kLyUx3iA7VnPa506zylZ+pgZ24HSeklDijNAFjUtvYUnouf5Wz X-Received: by 2002:a05:6a20:7fa9:b0:171:737:dfaf with SMTP id d41-20020a056a207fa900b001710737dfafmr2330935pzj.5.1697545096447; Tue, 17 Oct 2023 05:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697545096; cv=none; d=google.com; s=arc-20160816; b=K1kG+kWYceS185src7URg03urwhyPxb+Gv1TWxqfJhfmX7vKV6Ua2g8UtKIw/U3lPS FYV5wiU10cnIItS0UHXLybYfOLTMLOlPcrBeOFZGdqudHKNppnECp15vvpaAAW+hU136 zDuHZlgaupDe/mM7PUMlqZAPXx4pqO53z9tZE8M+x5bIRXpFnTmIeHOYlt1CU8fheJRE vzw8bJH7SY16u2VUETmgk+1omjW/sLth8fRqJlo5d6ldSsJeimjCNFHDP3et3sPLcJnJ x5GoqOKbnrkWKUNM4aUEssMGBu/l0rQagnAv+aEPWkvwtAQXt0t6qRhYXHphVqr/9kun HwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=kmcQE5lRmLwcJo5cQwSR++3r6UQhsrhv/OAurZwBPg0=; fh=Vxe4qMNrZwzYwfxT5snNGqGe8TJ97uio17uk8FFobXk=; b=BEVgjtXjb4Whj27Zvk7BOuErSlU1Qc0FwbIJLLViTpPcmbVO+ISbp2gfjaGL1yqIPr ZwaZq3RvTbgKDZ95VADEQ2qbsU+Hd1ScK6w9pu11/ua4KXdLPhpscLxbS+QwzWgMPlHD nDIPbWakQ5LIzEQrxSNWKP++7kknR9lWT5Lq4zm0C2GoIqokcFTzW/IVv2FrQkwYuqfK etaEkEzYFWBGGbayl8wki6IhxXUO7ORbjSuXbU6isMX2yxseMjHZxGTML2ubl7zjKuZ4 VBHdfFvm0VNFL5RWHIp830O5RQQYa6LbPnFdykb0oM2Hx3hV1smClpZ8vvN3Q5ehZh0z rzow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sXkO+DS7; dkim=neutral (no key) header.i=@linutronix.de header.b=cYBm75hF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cu21-20020a17090afa9500b002790c6760dbsi847510pjb.70.2023.10.17.05.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sXkO+DS7; dkim=neutral (no key) header.i=@linutronix.de header.b=cYBm75hF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B62638029855; Tue, 17 Oct 2023 05:18:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233361AbjJQMSD (ORCPT + 19 others); Tue, 17 Oct 2023 08:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232577AbjJQMSC (ORCPT ); Tue, 17 Oct 2023 08:18:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789C0195; Tue, 17 Oct 2023 05:18:00 -0700 (PDT) Date: Tue, 17 Oct 2023 12:17:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697545079; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kmcQE5lRmLwcJo5cQwSR++3r6UQhsrhv/OAurZwBPg0=; b=sXkO+DS7ApDqGac3QgVoQWgzhfMsbE/c+Z1hFv4XDBHaF1XQrXjBDx00ouCpgRCoUQytf3 dOtfF3qbW7fM6JcVB5ysamsObIdD7FLOhXLNaSaWyaPxa17dZ4F5vaSEBfvcmLcrHLYenT gZ9uJukmZNkaNmou4i8ZicfsFZYWuH1ySBHWE5JoGb9q3xi1FbD+Iefo2eRgqHXFFJMtj4 ZsviT/BD/rfgO9MTXPCyWwZ1ZqnNrAVzxjNNF6v3GEKGLC/G1YxnzMleCgZg6dptf5Ojrh w68aE0ZKwqvgjMSna47BHODpINIVqHhJpC2n5OPSs+7O5Lpnp+IEoV/D6L6AFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697545079; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kmcQE5lRmLwcJo5cQwSR++3r6UQhsrhv/OAurZwBPg0=; b=cYBm75hFY1fLrsgQzBO66saFQq1lO6QP/vgsFWqx7bHhQFRPdMoAigWCTjW2HUk+KtubPR HaX2j48GosKtfxAg== From: "tip-bot2 for Babu Moger" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Add support for the files of MON groups only Cc: Babu Moger , "Borislav Petkov (AMD)" , Peter Newman , Tan Shaopeng , Fenghua Yu , ilpo.jarvinen@linux.intel.com, Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231017002308.134480-9-babu.moger@amd.com> References: <20231017002308.134480-9-babu.moger@amd.com> MIME-Version: 1.0 Message-ID: <169754507834.3135.8385571109591338616.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:18:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780005046933888818 X-GMAIL-MSGID: 1780005046933888818 The following commit has been merged into the x86/cache branch of tip: Commit-ID: 918f211b5e4e709e91acf856967a850569c96b71 Gitweb: https://git.kernel.org/tip/918f211b5e4e709e91acf856967a850569c96b71 Author: Babu Moger AuthorDate: Mon, 16 Oct 2023 19:23:07 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 17 Oct 2023 14:05:24 +02:00 x86/resctrl: Add support for the files of MON groups only Files unique to monitoring groups have the RFTYPE_MON flag. When a new monitoring group is created the resctrl files with flags RFTYPE_BASE (files common to all resource groups) and RFTYPE_MON (files unique to monitoring groups) are created to support interacting with the new monitoring group. A resource group can support both monitoring and control, also termed a CTRL_MON resource group. CTRL_MON groups should get both monitoring and control resctrl files but that is not the case. Only the RFTYPE_BASE and RFTYPE_CTRL files are created for CTRL_MON groups. Ensure that files with the RFTYPE_MON flag are created for CTRL_MON groups. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-9-babu.moger@amd.com --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 5814a0b..5f6d6ba 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2551,6 +2551,7 @@ static void schemata_list_destroy(void) static int rdt_get_tree(struct fs_context *fc) { struct rdt_fs_context *ctx = rdt_fc2context(fc); + unsigned long flags = RFTYPE_CTRL_BASE; struct rdt_domain *dom; struct rdt_resource *r; int ret; @@ -2581,7 +2582,10 @@ static int rdt_get_tree(struct fs_context *fc) closid_init(); - ret = rdtgroup_add_files(rdtgroup_default.kn, RFTYPE_CTRL_BASE); + if (rdt_mon_capable) + flags |= RFTYPE_MON; + + ret = rdtgroup_add_files(rdtgroup_default.kn, flags); if (ret) goto out_schemata_free; @@ -3271,8 +3275,8 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, enum rdt_group_type rtype, struct rdtgroup **r) { struct rdtgroup *prdtgrp, *rdtgrp; + unsigned long files = 0; struct kernfs_node *kn; - uint files = 0; int ret; prdtgrp = rdtgroup_kn_lock_live(parent_kn); @@ -3324,10 +3328,13 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, goto out_destroy; } - if (rtype == RDTCTRL_GROUP) + if (rtype == RDTCTRL_GROUP) { files = RFTYPE_BASE | RFTYPE_CTRL; - else + if (rdt_mon_capable) + files |= RFTYPE_MON; + } else { files = RFTYPE_BASE | RFTYPE_MON; + } ret = rdtgroup_add_files(kn, files); if (ret) {