Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp829307rba; Wed, 27 Mar 2024 13:05:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1CNG3jABHPCryv0IJMWF1CZQTVPCuaqSQmQQqvlWv0LbFKRigAO2V6pd8QctDgHbEQPuc8XsUD2vGQZHUzmPd75BvAqPUn4DCDvjCAA== X-Google-Smtp-Source: AGHT+IF7BGDVVQUMmnAxt+/PJqbr3bP1mDOiMFnw79kmQOiaQThEf1Yvw87Vx93MCg6tBSfyoJkH X-Received: by 2002:a05:620a:3620:b0:78a:14a4:3ca6 with SMTP id da32-20020a05620a362000b0078a14a43ca6mr632278qkb.62.1711569946232; Wed, 27 Mar 2024 13:05:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711569946; cv=pass; d=google.com; s=arc-20160816; b=z5nDWbc7mu1qOIRFWdNYa5FzpqoWg6QsTuLaB3RAULtwajxBk8rxFJKu2S7Oht8/PR sjNgmqI+Tlbzd3UtBx3ipeRzKxqug1s2SZIf1Zte8w/zYXYlj3gmJAWX4Y3/WUC6WFSA H+X1Q3IxUoQfYZTWkczn0a0ys2S28fiSjdwMLRis02nxnsI3fkbaKHEqZ2QsjEyjW4KR Xhum9zjv5dGniZ7vSnB2zIRttl4RSQn9ROAuavL5IvNWGIraAt8ZBw2jDW09uHbsDKyw +YWOtRt3bk5chFrDVeumDSzfmQJUX+YfjQchKJKh9bFrYQ7vwjgHnftGRcEsSnndAyMx QBYw== 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:dkim-signature; bh=KSDcExow68miUnV257jccYwJQx8sB1FnTzCeUDjnANI=; fh=H9/+fk2Ete/Gzpx6dba0TKFidU7mNxuKLM/h3KEx+fQ=; b=sX1cZRIzSOkLA+SExSdjLLtxZxSdzQvfrgThdfhxF8IP+zluUEy+rO+9LD3TzE84ou rGBqLP2et48GmTUvGPJJj1py8tIkDqLk/qWgolvPSFwQHVoWc7mW/GsV82cvChLXp+w6 k4vFqEXUtJzWmkmxEwk45gqkVSIGfj3zZZc7APRXeDlT+6fzp4Jq550goXq31YIlXd0u LavlV+eS/mgU5Y2NQJEt8P1Z8y1BMqM5SlrrJ6SSXFaTn8Acyn/XvyG44G7GDA5lHfE0 FgwHalLN3UB7n71OG/vJz0ph6O4r49Keb6dXjUXGQnA8ikVgrxUBKOIOr76kodkdO+kN s3Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pl4oGSM4; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-121951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v11-20020a05620a440b00b0078a5636bd0dsi8832505qkp.113.2024.03.27.13.05.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 13:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pl4oGSM4; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-121951-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121951-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 D5A6B1C3504B for ; Wed, 27 Mar 2024 20:05:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1232B153502; Wed, 27 Mar 2024 20:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Pl4oGSM4" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 2D06C1534E1 for ; Wed, 27 Mar 2024 20:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711569846; cv=none; b=LKGYLVD99KmzCplAi87k4CBQj92OZ2a6no+I2JDjmMTWJPAK0XYRMMmY2N6Sv8kZDXxJX6uy4TlaF3nXOq93oQqWlXy1nGrAwcO7bEeRALqhGvOWC0573wTwxRy+KADLs4mpC+2aDBUuOgHc48FyqgHyTkxA2GYorWSJ9HB267A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711569846; c=relaxed/simple; bh=p9PxKFKNPcVQ3UIxnb1saO+ycTTfGlj0Z2RcgpesIvA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k+6OBWzy3sln7tDUxPjDR1eMBn8V4Gf4MQYEnIN95+PR2ntnIiIAiwvDdEgJEyfuWi8ICwbK68NLrQX+g+LLGI/iNEEaOciwBdhL3yo/oWCRul9Y0hITPzIT9MpS3KIycDhFLNem8gIf0yIJd0VomVRJB1z5N+Yr9h/12ZAoR2w= 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=Pl4oGSM4; arc=none smtp.client-ip=198.175.65.12 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711569844; x=1743105844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p9PxKFKNPcVQ3UIxnb1saO+ycTTfGlj0Z2RcgpesIvA=; b=Pl4oGSM43duxjbwX16c+/sV0jt09CpNPuNT0nRJFt5ukZgS+MPaH9lk8 tAMTEhEO2DLHHFrmrk9Ha90viuFnRNFwGepVh0gB0ufzCvT4MTNlLAiy4 3+HLtWQb9L6wxbOMAiXGuOQHfXF79CQuY8N9XadN+O1CC870Gs6khjBxi psVpY9PRIqqCoeIZkcEIu6j86pZKTz+6bd4GsHVxTnhOZHTvObo5XWXmD 1+Baar5XpHbBHS4Gr23xwtnDOojhw/feiiIkUNN7KoyXXd38+DzQTXSsW mHliXuNIh4CSU/QqChF2WbuyQlM8M4+T0jHuByGQVYEMfor8iRVVrMpcp Q==; X-CSE-ConnectionGUID: 3hi88GGxRCW0bxroej9EiA== X-CSE-MsgGUID: of73pvr5QD+J1EvqByXqyA== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="18132969" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="18132969" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 13:04:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="16246107" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 13:04:02 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH 02/10] x86/resctrl: Add new rdt_resource for sub-node monitoring Date: Wed, 27 Mar 2024 13:03:44 -0700 Message-ID: <20240327200352.236835-3-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327200352.236835-1-tony.luck@intel.com> References: <20240327200352.236835-1-tony.luck@intel.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 When a system enables Sub-NUMA Cluster (SNC) mode each CPU socket is divided into 2 or more NUMA nodes. CPU cores and memory are divided between these nodes. L3 cache monitoring functions are independently implemented on each SNC node. Add a new rdt_resource as a foundation for the structures to track monitor resources in each of the L3 sub-nodes. Add new scope option RESCTRL_NODE to build domains scoped at the NUMA node level. Signed-off-by: Tony Luck --- include/linux/resctrl.h | 1 + arch/x86/kernel/cpu/resctrl/internal.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index ed693bfe474d..f39a07b27a98 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -153,6 +153,7 @@ struct resctrl_schema; enum resctrl_scope { RESCTRL_L2_CACHE = 2, RESCTRL_L3_CACHE = 3, + RESCTRL_NODE, }; /** diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 8f40fb35db78..24fad5ecc158 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -472,6 +472,7 @@ enum resctrl_res_level { RDT_RESOURCE_L2, RDT_RESOURCE_MBA, RDT_RESOURCE_SMBA, + RDT_RESOURCE_SUBL3, /* Must be the last */ RDT_NUM_RESOURCES, diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 4c5e985e1388..395bcb3199f8 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -115,6 +115,16 @@ struct rdt_hw_resource rdt_resources_all[] = { .fflags = RFTYPE_RES_MB, }, }, + [RDT_RESOURCE_SUBL3] = + { + .r_resctrl = { + .rid = RDT_RESOURCE_SUBL3, + .name = "SUBL3", + .scope = RESCTRL_NODE, + .domains = domain_init(RDT_RESOURCE_SUBL3), + .fflags = RFTYPE_RES_CACHE, + }, + }, }; /* @@ -487,6 +497,8 @@ static int get_domain_id_from_scope(int cpu, enum resctrl_scope scope) case RESCTRL_L2_CACHE: case RESCTRL_L3_CACHE: return get_cpu_cacheinfo_id(cpu, scope); + case RESCTRL_NODE: + return cpu_to_node(cpu); default: break; } -- 2.44.0