Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp76522lqp; Sun, 9 Jun 2024 17:39:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVlFpsJLEws0AT9riYAcihMVxGTDv3ZZLK5IhTP2TRmmvIGTy+9GSwIpb74m0mCs7oH/mSFkjd+GsJHQ/c5knBzQlCe1FD6BcfbgiHRg== X-Google-Smtp-Source: AGHT+IHzhLV1rNQ07htURmabrPbZ7bG9MwbW1TcZIYg9z22Rts5KAKOCK5E3R1G+VmHXEC0i65c+ X-Received: by 2002:a05:6870:470e:b0:254:ad5e:da49 with SMTP id 586e51a60fabf-254ad5efae1mr2995932fac.41.1717979989336; Sun, 09 Jun 2024 17:39:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717979989; cv=pass; d=google.com; s=arc-20160816; b=rD7Q2jmb+4rCR48hxgkNEbcIHXqNj0Vz5trIQimVdJ8TB5ibPlzj5WyTKf+L510/Ln j05YAeh/dlbGP7mjcnOvBT/RDtKXIwOpfpCd2f9YtzuaeIauLkWs0aPmLnnorIMOxqdh Mnhxk/EE0j6owe0PNu68nNq0QKXA9jPevN6wfCZWj69AepZ/5rI21MVB4cwJYMuqzW1U /4w2JOXAq58/LmujZhqvjLivrZjMjHZAPnQe+7RgzqT80uTrizqOTQN0Sw9FBZz6uWej 4UB1Qd8i1qie0BvTPW2QdH/5iXa3JCMF9iqrIRXsFB6gcaSgGj6lqotohiwZh2nwr8ov CObw== 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=wchnnhb2A3DEuVr/65lZXkBIlD6jcFKbXUbLfKW7zAM=; fh=zrVDlrC06DAIec5BvDl2IM9WrZzuc2uxw+nPFYRCHpQ=; b=dHx1r/ADacWN0v7SFUYPnEEBxSqA11t3gwF4A8vdtvedTzwcM1AAE+L5zyiW7WiOVl pxqSgcO2YBwBzqdVuMCCmgBwgVMXvcRxILOh02Lh0tgbXLiYdLgEzHe6T2wDA3XE9PpA S00BlkXiZWsccmnQ7DuqhGHuGTaGZAmgOaB5B0OFUN8JZD9ykG3T5v92HvX1y/JbGVR9 rEPMtPSu5Q+JBbYrI2ooGhBscNZapxXBClpALZsxPhYHy993Yxk2OizR/8SgbeAXgiD4 mCjOGbxwQIYcgwnBwHUdZuB1OqBNkbeVOJZrmtUTfoq1vLMNRCWsdPSuG9SScZKBusU0 TMTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XSz7qihF; 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-207574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207574-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e5469dd1easi3859468a12.113.2024.06.09.17.39.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 17:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XSz7qihF; 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-207574-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207574-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BCE8A282004 for ; Mon, 10 Jun 2024 00:39:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DEF04428; Mon, 10 Jun 2024 00:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XSz7qihF" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 EA11B15A8 for ; Mon, 10 Jun 2024 00:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717979978; cv=none; b=BM7r6lazpA4STV95PhYlUtsDlOOsTHinzTTyp8fVJzLx/VCDSANbCYHZoh67aayXdvSxlMP8ufUKO9NcH/senvevThfJCBnxjgjnWJnxVkDefvXh0P0ZMqpS4tg+FwTjAz4KKF80ueoV7tmL6OZ9UEiqw6XoZJNUUdXPvWmiCeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717979978; c=relaxed/simple; bh=waD4N4XEB7SeuiB+bDbo3csSeAsfiUzOoJfHZThocuo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=X1iKGDzEEnIjsLSMw52hSMpoQDG6NSwFiuVPg8RqxcRPZcmjizpDcIY9fFePl1WbMqAH2uk7JIL7HZdDpgkm98YRAtEtnfKvpRlwrlM8Lt1GjYsDnDJZjKW9lx4TfwxBnIhojdF1T/eRyn6vqogPwYK0HdozUBno9Q+o1A4zwQM= 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=XSz7qihF; arc=none smtp.client-ip=198.175.65.9 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=1717979976; x=1749515976; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=waD4N4XEB7SeuiB+bDbo3csSeAsfiUzOoJfHZThocuo=; b=XSz7qihFb9Ux2l+XTHbGmp1tEB5VTWrOVOVK9d7j5HsM9VqEGH/qKwwo LusDq8SIxFVSZpNusu6+CE3ynfOS/6kqly/AV9CxQJgDPuNga+gUWbslF PM3Ua4Ev7Y5vJXW31dsqnbwais3BedjrQCzZo66Iyz7EghfSoeQaehhxC G4Q9ImGsAdojwoyDdgMIOnkDIvIulubuNDz0HqR88z7UOo2Q75H/Dhf0A PnD+jg37y+0A7LZumS0SCQ6OThDHjAFqqWi2L17EUMU9T3DKF1zRD+hGe MA4PLsaZBnpZ8GdZ1i9ImuCXt+6SKJjksNLqtgPDjDxvwxnNc+pJz/fTu Q==; X-CSE-ConnectionGUID: SbXBkiSJRn+8xUbFjJYwMw== X-CSE-MsgGUID: NZ8kvDEwSlGhr+aO4w5gIg== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="37154956" X-IronPort-AV: E=Sophos;i="6.08,226,1712646000"; d="scan'208";a="37154956" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2024 17:39:35 -0700 X-CSE-ConnectionGUID: EaSIL/wER2a+RZJ90UDvAA== X-CSE-MsgGUID: RII/kgt4QsyOrjGd56fy/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,226,1712646000"; d="scan'208";a="38829874" Received: from agluck-desk3.sc.intel.com ([172.25.222.70]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2024 17:39:35 -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 v4 0/4] Add and use get_cpu_cacheinfo_level() Date: Sun, 9 Jun 2024 17:39:23 -0700 Message-ID: <20240610003927.341707-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 v3: Link: https://lore.kernel.org/all/20240606164047.318378-1-tony.luck@intel.com/ Addition of lockdep_assert_cpus_held() in v3 led to #include hell because needed Patch 1 resolves this hell by cut-and-pasting all the CPU hotplug defintions out of cpu.h and into a new file cpuhplock.h. Patch 2 brings the pasted code up to current coding standards Patch 3 is the previous patch 1, but adds instead of to Patch 4 is the previous patch 2, unchanged. Tony Luck (4): cpu: Move CPU hotplug function declarations into their own header cpu: Drop "extern" from function declarations in cpuhplock.h cacheinfo: Add function to get cacheinfo for a given (cpu, cachelevel) x86/resctrl: Replace open code cacheinfo searches include/linux/cacheinfo.h | 25 +++++++++--- include/linux/cpu.h | 33 +--------------- include/linux/cpuhplock.h | 47 +++++++++++++++++++++++ arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 17 +++----- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 +++---- 5 files changed, 79 insertions(+), 57 deletions(-) create mode 100644 include/linux/cpuhplock.h base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 -- 2.45.0