Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp876371lqs; Fri, 14 Jun 2024 08:08:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzaEwk0pi2Qel6pERjX2AB40KmIOh6rO2U/BEt/dn4oe1cn4btXB98tdlz4c9MIWI2rNu7rS7IAGmP67DMfo5vKY5atLNEMxmWp2XjAQ== X-Google-Smtp-Source: AGHT+IHji7QqRuc3/vGhFrz4dGKIT2XyIfZF3R3e9dWd0PQUpsW5RXm9ATohA/bFL9kIw7RwB9UZ X-Received: by 2002:a05:6808:f89:b0:3d2:37e2:1be0 with SMTP id 5614622812f47-3d24e8e1557mr3414821b6e.18.1718377698808; Fri, 14 Jun 2024 08:08:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718377698; cv=pass; d=google.com; s=arc-20160816; b=r9p0R66srogyJEXVh2k7xuvaD+m7vVO8YIR5jmhlf1tN7OfnxFl3mdcQGhn3WFAKq0 zb/r6tzrnjYrA10A2Gujdx7rf7dEOgZv9qvDUoqd3BRBDrhPe5Mrtx3M45kmjn978ZMI pa7wjeQmb7Ybh07dOX5HiqVZcJTi825Plq6Oui1LDMaqOU1l77NePPcVNLbw1NLLpiCU dePmZrtBDO+WtsFZepbt31X+Uhd5u7qcohp7kkqN+Grsv3DmLzk7OR8/wpq2Kp4q1XA6 SEPHXMPn8QcC7g4r2CQ8r2eXihVziwbK9pF1qvdkmAc8LvFh7Hn0G8RtODz8LuBIM31P 3gnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=eD5KlqNCKT8IbSVo2VbboOM4w3HBa600MrvGi/X6xlk=; fh=ZzIMw8TvFOndukyZ2OYtyPajIHhdrLW0CERhi5Mu63Y=; b=V8Iy1IiiNuThQQn1NuGj3fIEyHI1Sq5LbRgsWlm8e3sCwkKweEMunvnvvTqAenxez3 rvbSkV3mlQphiC0vWDH8IIDnQztNsZo9uaSoohqAJcaDUGUL+n4NuRMgEv+qdyAVpUiZ ZhS3DrCeB0PGhKqFRoFIxTNSjM84+8RmPAsyhgIU9DqBx0I+eN4i+jh9+IoXGoABUVHb A8PWDoL9HfQRWAeTiEA3mxzud2+EcJnZ0+7WSw/FbyS2wASBKKvXLUDp2hNpmx9Qg028 hH8NMCcl2rblIpoJgo2OIyJeDWKxoNcfua5mlf1KQjvEiLXsfnntQnMS7gLseRxHP9RT EiUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 00721157ae682-6311aa235acsi12227567b3.219.2024.06.14.08.08.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A1341C230D4 for ; Fri, 14 Jun 2024 15:08:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7C8916A36E; Fri, 14 Jun 2024 15:02:56 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B9881AD9D1 for ; Fri, 14 Jun 2024 15:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377376; cv=none; b=hIXz9pVeh2xLMF/avqEFBCAdqoDGphf+16JiL6k0JqNyWzXo5w/c0gjUX67tlAVAAK+DtMQAzmnBD9H13K5/bWwmts30N0+5cqEJi+jDd+caW2aB732EwOdBVs1lhug8lk2ADFvm910egklgBnexSsi05BLrk1+dx/zoHFK44jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377376; c=relaxed/simple; bh=+3Soj0kD8hxNHqrVcReknL5onwEgba9WwufNrUBAq8E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lAkIQQ0gCpP6pTuyZx6RoptbgL7NwbWUD83yF9la4WHYjPS3RLlBM0AMII9su68I51M2rOdDPtMvOKkhHs17SRvIDN72qPXx/t/i3hZCsv+yZhms1lbinMrptfO1M+ILVv9FdmdJjth1Nn5IF8c3h3o9kWft6bVusHORAHIpHZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 532391BD0; Fri, 14 Jun 2024 08:03:17 -0700 (PDT) Received: from merodach.members.linode.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A159B3F5A1; Fri, 14 Jun 2024 08:02:49 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie , Dave Martin , Shaopeng Tan Subject: [PATCH v3 31/38] x86/resctrl: resctrl_exit() teardown resctrl but leave the mount point Date: Fri, 14 Jun 2024 15:00:26 +0000 Message-Id: <20240614150033.10454-32-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240614150033.10454-1-james.morse@arm.com> References: <20240614150033.10454-1-james.morse@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit resctrl_exit() was intended for use when the 'resctrl' module was unloaded. resctrl can't be built as a module, and the kernfs helpers are not exported so this is unlikely to change. MPAM has an error interrupt which indicates the MPAM driver has gone haywire. Should this occur tasks could run with the wrong control values, leading to bad performance for impoartant tasks. The MPAM driver needs a way to tell resctrl that no further configuration should be attempted. Using resctrl_exit() for this leaves the system in a funny state as resctrl is still mounted, but cannot be un-mounted because the sysfs directory that is typically used has been removed. Dave Martin suggests this may cause systemd trouble in the future as not all filesystems can be unmounted. Add calls to remove all the files and directories in resctrl, and remove the sysfs_remove_mount_point() call that leaves the system in a funny state. When triggered, this causes all the resctrl files to disappear. resctrl can be unmounted, but not mounted again. Signed-off-by: James Morse Tested-by: Peter Newman Tested-by: Shaopeng Tan --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 403118fdabd4..ddf3d0a26517 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -4255,9 +4255,9 @@ int __init resctrl_init(void) void __exit resctrl_exit(void) { + rdtgroup_destroy_root(); debugfs_remove_recursive(debugfs_resctrl); unregister_filesystem(&rdt_fs_type); - sysfs_remove_mount_point(fs_kobj, "resctrl"); resctrl_mon_resource_exit(); } -- 2.39.2