Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp404027lqr; Wed, 5 Jun 2024 09:14:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1MbQPl412Ca+2f0QMPmFCjil0RVKICoiXHIhSVT5Nhox8bgHeZfkjx7Ui4276nAw1xw4hnt2W2PmZzBzGBwm/wzNpbvIBZ443KWmO4A== X-Google-Smtp-Source: AGHT+IHgNblofNsJYAX8MM9f8BomRXNQTymhpaGcXx59rqh1KFIEYXU3U8Ujf+gZ2fFSOdPsJcFL X-Received: by 2002:a17:906:cb91:b0:a68:c672:9ea9 with SMTP id a640c23a62f3a-a699f55f7d6mr185856266b.28.1717604086872; Wed, 05 Jun 2024 09:14:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717604086; cv=pass; d=google.com; s=arc-20160816; b=s3G3+001xpgvcRCuOFjZNV3bcJjia/xA7jioTygw/w6a/JH5n84gZg703ynBvKAqqG kdp5pdvM87v1hhRoCqJKf4vuk3xIQEQKMAylXBdfcNIwSa9Vxrp/b0bsBCKxB3ZhL6qU GyklI9QEDSNGY12aeY6k2dK92oqvii186kWsrh2Bs87pojJriUCAf8YKniOAzmvPPuaz l08EHDeuN0R101oKZgz/ecqOn1TfgeNLdhnii7nf15HGw2M4Cf1FA+VTtmNjWbMKaCa/ 623rcLtcnVL1A7T3gLrZIBeKW3kjxRLrHEtulRfkjtilKJaioslW4o3HS5r4oc93ow3I 4fcA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=fJY4VQDnlQ1S1hjCO7TTHB9d9vJBWwie1dWoC9ZjXb8=; fh=zrVDlrC06DAIec5BvDl2IM9WrZzuc2uxw+nPFYRCHpQ=; b=CqmJcuYZg61hpjXKvXGSj8GpAmoTskVTAW8zXUZQlEy6PQm9/6cB7hmDymusICVA5t 0N8xhR0hozHueCKKZ2zobFgt93OUR2Yjf4ee+yIrZvurqq3dlVu5oGZw1Pzqjndst9er hOXfHaSDnD141dM9k51o9pSf7vWaGBnGpJk/sTNEwzi911GLJesTuL040+Crh+y/or1H m2kzEIEnH78SL+fh+i4sbG/XT6eD6qUX/99aBSzb/E2W7ecGC5h2dGsr9GLelxrfDiyP +/vtGlbtWI6Wwp44k9wVaZRAG44A4XERkxMYriqkfPMujZQsAAK3LKw10Q4HX2oufBSa AJJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ccCWP6S1; 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-202893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202893-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-a69141ecff9si313000666b.557.2024.06.05.09.14.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 09:14:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202893-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=ccCWP6S1; 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-202893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202893-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 9113B1F2281F for ; Wed, 5 Jun 2024 16:14:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F37C1156F56; Wed, 5 Jun 2024 16:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ccCWP6S1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 9A7FA1527B5 for ; Wed, 5 Jun 2024 16:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717604079; cv=none; b=ld02Jd7KQ12Ga2asXp5AUSir0ojEP87iOfsOug7U7sF3hHSplV7aOgca/JyNGiXgly0DyE+58sQSzrfqI3QAKtuIK1tWg1V6kgp0R8QAtideBUFwj/eYCanAiw7t3kHptYkQlfySyHqR+SAZAlUkTiHrQZ2V3hUeIeSKq08RqIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717604079; c=relaxed/simple; bh=dYRxACWS2D/qY2OE5vaGsvS2+7L87gFzA2dBpDDdBzU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=g+qVwfoCPMxu+Fpd+H1b/G/f/PCfvw1xXWfmveB0mnDHBiFfrl/GQ7PjK5YXINYcJHsZQbpuriH0eshID8x8yPLpcbGQboJFKLnQ46WnBza5Yak7300Hi8bZWmJK/HpCvi+aj2HRPlouAnlbfp2DsZilIO5HwLT4fB1ke8V8QFw= 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=ccCWP6S1; arc=none smtp.client-ip=192.198.163.8 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=1717604078; x=1749140078; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dYRxACWS2D/qY2OE5vaGsvS2+7L87gFzA2dBpDDdBzU=; b=ccCWP6S1R/VqT+GiG0hnLNqXUbOsmd4CW8zieAd3bRI9qmzfpCnQZBrr 8ETZa7OPi3Fait4KGoA+RZv+vcE4+z5HB2iLNMEVlCPVv8EqP9UR+Ioon GTrsnAi/+uJHwFrVMMhrqll8xoRnU11jhJS7meP4h6KmVxnQDi23Qkyj2 C7t055bpT2HmHseLdD8xeMUn1O/KZKMF4oToYxHdBSGzV29PdQ3zoz6ZW LqTlVFOVsJRj/WFX3ArVc/JpaMU7oWZV7YLhu19uM7Mj0gWB1gCRiULzE bysPXCpE/DXWUt8pD3cBVxFwhB2QuYlE5ji3eBC8UYMCsEmcGdE4Ce4Ku w==; X-CSE-ConnectionGUID: 5q7kHWUlSHGOnec+UZVB4A== X-CSE-MsgGUID: UYcVV+liQO+QFTRin7bP2A== X-IronPort-AV: E=McAfee;i="6600,9927,11094"; a="31772285" X-IronPort-AV: E=Sophos;i="6.08,217,1712646000"; d="scan'208";a="31772285" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 09:14:37 -0700 X-CSE-ConnectionGUID: sk8BrQSVQNSDq1bvbPLcWA== X-CSE-MsgGUID: tqRHwGzOROaEp7oFlw07Zg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,217,1712646000"; d="scan'208";a="42581895" Received: from agluck-desk3.sc.intel.com ([172.25.222.70]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 09:14:36 -0700 From: Tony Luck To: Borislav Petkov Cc: x86@kernel.org, Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v2 0/3] Add and use get_cpu_cacheinfo_level() Date: Wed, 5 Jun 2024 09:14:24 -0700 Message-ID: <20240605161427.312994-1-tony.luck@intel.com> X-Mailer: git-send-email 2.45.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This helper function came up in discussion of the resctrl patches for Sub-NUMA Cluster (SNC) support. Reinette pointed out[1] that there are already two places where it would clean things up by avoiding open coding. The SNC patches will add two additional call sites. So rather than have this jammed up as part of the SNC series, I'm posting it as a simple standalone cleanup. Signed-off-by: Tony Luck [1] https://lore.kernel.org/all/050c64b3-20b3-4db6-b782-f5124ebaab31@intel.com/ --- Changes since v1: 1: s/for cache/for the cache/ in comment for get_cpu_cacheinfo_level() 2: No change 3: Fixed broken firtree declaration order in rdtgroup_cbm_to_size() Added Reinette's "Reviewed-by:" tag to all three. Tony Luck (3): cacheinfo: Add function to get cacheinfo for a given (cpu, cachelevel) x86/resctrl: Replace open code cacheinfo search in pseudo_lock_region_init() x86/resctrl: Replace open code cacheinfo search in rdtgroup_cbm_to_size() include/linux/cacheinfo.h | 22 +++++++++++++++++----- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 17 ++++++----------- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 +++++--------- 3 files changed, 28 insertions(+), 25 deletions(-) base-commit: c3f38fa61af77b49866b006939479069cd451173 -- 2.45.0