Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp303912lqo; Wed, 15 May 2024 15:24:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOd1nm9q1FHe/dYYQ8/CP9E1iHjtf4ISCKwWC2SwtmQBbZZlY3AX9+xOez5XA4wOFSUiypV1Xx15pC44mMH2rEPtc0JMB/oGOIe4wpxQ== X-Google-Smtp-Source: AGHT+IGCmzbWM74v+ZDLYWFq9Xj7WkFX53lusG4H5h+489NEtkBV86AmXmx/slit2mqgvZDAVpp8 X-Received: by 2002:a17:906:31d7:b0:a59:ab0a:a170 with SMTP id a640c23a62f3a-a5a2d18a9c2mr1395699166b.1.1715811852003; Wed, 15 May 2024 15:24:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715811851; cv=pass; d=google.com; s=arc-20160816; b=Q9XRT8bfGFZZfouKLeUxOdwkicxBa4jJQ5nY8ctOQa/v70Emr1iUJtpE4O7uZY+ThY qX2d1DnL9K7+C8v7jb/PqLt3VIR1QlLjaVs9AYgcouyv+9OsK6HH7q0m3uRLBpObaKSC uOv9AsqkLIqDtxnvFttztDZE+ZOh9Ff/mHRbapWn1r4JIXRQhc98dqHMN8kdyvA36/Pl deAR+jYzDEUle6H1rcYnnF4+KHKDIpDs3qmZqka8qdBo4vEFrvbixZ4mbrXJJrJ65QPy VDHryhvwFnQf2thQodIYF1IkVKd2eMafgtV/6r6ZZP1VGtMXwZX9TrctG+4DNpOefsx9 Ai1Q== 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=FrkJpbquZYqkwP3PDQdEM2q4VNiH9R37mZwEgQZyoY8=; fh=qTx768JYq6oxdX3jfjUzjJGF83d0IKGtQzHdow3lchk=; b=R951vLZvy3c8K4HnEWh4suxjjkb/QXPtLRp6QiHpRYvxzchPM8nDTXhQHfRwAJ5Scj g8j+tiJsd4RS+0l+TOVJL83jNhSJZung/yQ2Tm2iFjU+3b2GZ7JUp2MqAXCyUP0XV7Gs LOCbhOKzxIWRkXtZja+a9SLTchpB8FTqFv93u0e6R6lj1sPdrNI9qXXEgpMRK259ipBj d8g2V06nN8DQEzri2WDmW/Vn0BE24GhbXw85cfNjFVAZ3uV8WXcOkK9YCQvJtMlTuUSE C66tpQaJwhrqo5NDYnWL+qOXZwZo/+BXqTdiZhhiGlM7m/3nticNQxlkcSGOE2ybc2Oy mhGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VPDuJaep; 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-180429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c8a6si790774766b.1029.2024.05.15.15.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 15:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VPDuJaep; 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-180429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180429-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BAFF91F22270 for ; Wed, 15 May 2024 22:24:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB08915D5A6; Wed, 15 May 2024 22:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VPDuJaep" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 2F71A15B98A for ; Wed, 15 May 2024 22:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715811819; cv=none; b=Lc1JQOzoDXT2oghaPuplZR1y0reQKAcNJM+6NuPyV3fodt4JNQ662MuPP9MSZ74XPj45Syp8cZLA2zBQiAc+sIuhcMn+XZvWhVBbwPknEyBGBYWwClWLbMKnLWugcbLyAc8sx8Q8/QJCQ//dzhbCPzQ5csPdejWQ/exf0Du1hqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715811819; c=relaxed/simple; bh=8vvxnIKvUMKP3JQZuwFtDwcmDJe7AfWCgztSHDNn+mY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AvoEMkmGmLPj+Ms8iFmDWv0UVtv0O7S5NfXDbV+WOVzh6ubdqTnHuNHV3dap7E4iyJ0tDuNFkG0zx1aeYJc1YOHkYQNfTIMi66S+THDirxm1F60f9zsl+UQU6/9JYEMfFIqSdBtX/w9xAHLjpJIFWP18YX4VPTbFF1cspZTPVtE= 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=VPDuJaep; arc=none smtp.client-ip=198.175.65.15 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=1715811818; x=1747347818; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8vvxnIKvUMKP3JQZuwFtDwcmDJe7AfWCgztSHDNn+mY=; b=VPDuJaepudN4wVEUMCPklqcgxtyfYg6t6RH9DSwUB8Drx8q5ktvVwsD7 W1TA1jUUS1S5a/8/xQGr+l6YxmyWS+i30OuzanwBsFLjRqGcZVqCQXSF2 oTfcUV8NlNJuapKl4ZI9+JUNieiVYDYaXisK6QDvyBa9Un7otOSVJ8tMs EQ9OVNZ+8/8hQ0RQEQ3bYV5BSFEuP2+y50aktbRQ6QfgzIMFo7BC8crcL fuAIUQ9738dO+LXClfRLLQbjRcnHUWvMZGgcsF8Cub3ZtwDwL55mly0hV J3nuD+unXBg1HfZctjKoqZdQBcA9UOZ778GEReHrmO8QAGRP8OclK4L7w g==; X-CSE-ConnectionGUID: gpgfBVP5Qd+bqlTIyvAolQ== X-CSE-MsgGUID: oGi4VXuJQfWR0jFA9tdZ7w== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="15671618" X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="15671618" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 15:23:34 -0700 X-CSE-ConnectionGUID: EXfBz1KxTbuQXWYCIHgcWg== X-CSE-MsgGUID: t52p1nKpS/O+p/zmAOAwYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="35989147" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 15:23:34 -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 v18 05/17] x86/resctrl: Add node-scope to the options for feature scope Date: Wed, 15 May 2024 15:23:13 -0700 Message-ID: <20240515222326.74166-6-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240515222326.74166-1-tony.luck@intel.com> References: <20240515222326.74166-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 Currently supported resctrl features are all domain scoped the same as the scope of the L2 or L3 caches. Add RESCTRL_NODE as a new option for features that are scoped at the same granularity as NUMA nodes. This is needed for Intel's Sub-NUMA Cluster (SNC) feature where monitoring features are node scoped. Signed-off-by: Tony Luck --- include/linux/resctrl.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index aa2c22a8e37b..5c7775343c3e 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -176,6 +176,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/core.c b/arch/x86/kernel/cpu/resctrl/core.c index b4f2be776408..395bac851f6e 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -510,6 +510,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