From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9918B824AE for ; Fri, 28 Jun 2024 21:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719611795; cv=none; b=MoF2vjR31rwS+AjEtw38oJBz0Nykgit+y+lYaEPp3IYzyBw2wbhNlWPfUIZVJEwdpR0Sjq53/U+1QJvaGqV2SNQ7f3uI1FYTu7b6Tc2jXeKipOfOWCDWI7oQZsN5eBQNT0oXTPC3Mz30IKRA+uzVtMvFX3NImWnGnhU2C2IpS+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719611795; c=relaxed/simple; bh=UvIfSDsXNSkpE8HdTCsK3woWdj4Uetp4PIewuXeA0AQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YxNrtujoZxZuMPTtsQhQseY16XnFAifQXx/SoQ39YsXU2llvQLOYhVsm0A/qHi7h9uBbT1nOACHypkPugKcCZAy4upyy7yXgYcvHOQ61sGzS4ObcdnDIL7sg4GlaCk5GuX3IRMoRgXIyfriQTjdAMM7gsFPBbqUTxiAlPkVp/0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=n77fBZ5A; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n77fBZ5A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719611794; x=1751147794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UvIfSDsXNSkpE8HdTCsK3woWdj4Uetp4PIewuXeA0AQ=; b=n77fBZ5AReKZhXz7DsDZW4vzhov4rK9HkiJjtu6orX/Wf/J+Ch1f0kfO bgtvw6uCod9odCqumqeELHbUtkdkZZHwIYkEhFDq5rT8HnChO5M6WOruP BMrWxrfGYdClym9rLOR36DzOyzH51uOtnIksTmo12W3BJhCMaIR09SGKn HTPTvBHWllV5WG5UkDa44ZTDSYJODVRxpM2b5wSzg4o8GjoftYYXpp35h Uu9L4EjeQ1mxFWAa9FlE9wq4/cP0Y3WaSY+AMoW2OAY+Pp0RBO/NhhMBL aFC9iUAi06mSIrNQs1O4/fmwnZShwN1ss4L+mFLevrLnLGjn7mOuPmD4O Q==; X-CSE-ConnectionGUID: LCPY/819SkWPAWpqYu6rug== X-CSE-MsgGUID: Ni1XZH2KSd6eXTky6bT7JQ== X-IronPort-AV: E=McAfee;i="6700,10204,11117"; a="16762576" X-IronPort-AV: E=Sophos;i="6.09,170,1716274800"; d="scan'208";a="16762576" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2024 14:56:27 -0700 X-CSE-ConnectionGUID: cgduWIhdTsOVkAwsQjrhRw== X-CSE-MsgGUID: saQPrqvxSHqNARJQh718lQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,170,1716274800"; d="scan'208";a="68065654" Received: from agluck-desk3.sc.intel.com ([172.25.222.70]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2024 14:56:27 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v23 07/19] x86/resctrl: Block use of mba_MBps mount option on Sub-NUMA Cluster (SNC) systems Date: Fri, 28 Jun 2024 14:56:07 -0700 Message-ID: <20240628215619.76401-8-tony.luck@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628215619.76401-1-tony.luck@intel.com> References: <20240628215619.76401-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When SNC is enabled there is a mismatch between the MBA control function which operates at L3 cache scope and the MBM monitor functions which measure memory bandwidth on each SNC node. Block use of the mba_MBps when scopes for MBA/MBM do not match. Improve user diagnostics by adding invalfc() message when mba_MBps is not supported. Signed-off-by: Tony Luck Reviewed-by: Reinette Chatre --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index eb3bbfa96d5a..d3b0fa958266 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2335,14 +2335,18 @@ static void mba_sc_domain_destroy(struct rdt_resource *r, /* * MBA software controller is supported only if - * MBM is supported and MBA is in linear scale. + * MBM is supported and MBA is in linear scale, + * and the MBM monitor scope is the same as MBA + * control scope. */ static bool supports_mba_mbps(void) { + struct rdt_resource *rmbm = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl; struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; return (is_mbm_local_enabled() && - r->alloc_capable && is_mba_linear()); + r->alloc_capable && is_mba_linear() && + r->ctrl_scope == rmbm->mon_scope); } /* @@ -2750,6 +2754,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct rdt_fs_context *ctx = rdt_fc2context(fc); struct fs_parse_result result; + const char *msg; int opt; opt = fs_parse(fc, rdt_fs_parameters, param, &result); @@ -2764,8 +2769,9 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) ctx->enable_cdpl2 = true; return 0; case Opt_mba_mbps: + msg = "mba_MBps requires local MBM and linear scale MBA at L3 scope"; if (!supports_mba_mbps()) - return -EINVAL; + return invalfc(fc, msg); ctx->enable_mba_mbps = true; return 0; case Opt_debug: -- 2.45.2