Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp304303lqo; Wed, 15 May 2024 15:25:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeitYHlHyL5FyztH8Ua2XlzI28aiooCSqrK8xuRXGxAS2S4bC5uob35jkts2yqd+CHt11OA1DDQcG6vZ7LsBBRCF9HABS4s2F11imX3Q== X-Google-Smtp-Source: AGHT+IH+fpZIxcIXZX82R58MgAnoczDFZousiNG+mqcmmJe1MzQ68Dq8UgR4FaYZRnefXEq17aoS X-Received: by 2002:a17:906:ca4b:b0:a59:9eab:1630 with SMTP id a640c23a62f3a-a5a2d680ddemr1212767466b.69.1715811904444; Wed, 15 May 2024 15:25:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715811904; cv=pass; d=google.com; s=arc-20160816; b=HHB+txxnTh7Q8yr0HRatvaN79x0UYpcV00KAgRWu/qE2XWS1VQDxDN3LIcQ1WjJqCN rFztVlxFIb7aLM0r1aEkN+8qNKAn6FT4j+4xkd/CCxgYFtr6mI0HH0UvgznQh3XgyPKY oSO70zR96a10UDnzdfUYStDPMIjrmnwwfeHNfd7UMWVWqwGach0FhMAXQUlBsVL7r3ca LIKzuZMdsQAfulmkhcB9dsgHsndniNGiF3IOUZ7n/mnoS9Zw/uWTfzHS5nazIlgpfxQ1 gNp+5YJE0k9zCI9uZH2onswHP0aAkA6NmddE8lRXR0Q1CkWmZ3E/hJS0L0Aak10iN808 0TMg== 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=oUNtSW8ZlpxHT2TpmOVFlBFujn63p2GhPtWVpVp+hAk=; fh=qTx768JYq6oxdX3jfjUzjJGF83d0IKGtQzHdow3lchk=; b=yPr1zdYniEWjy6z5BQLQh6fW0Ba1rIyuP85xOkbGgttlh5Yf2sig6WQh1zDx9XTWki pSDRWgky9SCYnumDiif3sjlMtNidkyBETF5lm4ujXPyBs+pVIs0GzqriqKUTjT2ce8IS 5L0sI5eO3vTzicE3FycVNwGv2RlTCTKq4/B0HxoGllQXxuSp3vwdtuFbjCzQ/xLfjcgW w/Ms1Qi/IvuH2jMrhE1ymr8h+H35t5+xigzBgx2V/NauLgS6v1DxDaKvtydIYj3y7uaz jgfxLfjON6mAEs9i/wQCvbdN2itfI/S0xycOKYvZsjNZ9DAr5mm7LVAAHk4feUOWTlUN aaFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cdf14LXn; 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-180434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180434-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-a5a1797c8cesi746149266b.246.2024.05.15.15.25.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 15:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180434-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=Cdf14LXn; 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-180434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180434-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 30E931F23361 for ; Wed, 15 May 2024 22:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6644115EFB4; Wed, 15 May 2024 22:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Cdf14LXn" 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 B1E6315D5D6 for ; Wed, 15 May 2024 22:23:41 +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=1715811823; cv=none; b=cVbLJ9g8+e6A8CAcpifltwdsJYSU/r6c1CbPJJXpBv98AnWHqM4NSGRiKtb62cZza897sLb8FVeHLJ3ssfOtLPNOSYmt93Qr76H0SUTNInhngrM++KwxdFxjzgiyc847FsDP0e2UqHiTDoClFp/K8C2otlvQGFxIYVutnnPExa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715811823; c=relaxed/simple; bh=fZQWGJA37S+/5/Zhu3Tw50fNZ5E9v7U/ReujXZVCtGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DRhvqZ2goQwu0efPaNOUQ+rRAKRp++zWuIITMXbg3yfJgu23hiKSmqqvLR3bei6lGFlkg2UfxGqRDiZW2tnnaIgmZldiTS6+E6gZUYWzgwHMcovnIBXm6Wnc2J/ooLCM2lKXafFYSZTeA5XsAStl3YX5+52ubeOtz2MUSRXEqDY= 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=Cdf14LXn; 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=1715811822; x=1747347822; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fZQWGJA37S+/5/Zhu3Tw50fNZ5E9v7U/ReujXZVCtGg=; b=Cdf14LXnGy4fujhrcMM0uJPHI+F9ZQwpyczwudyJPPwNF9C+R9u1ULT5 TWjz35WV3J1n20sZvfKMDlX6Vz6toX2foYtCEI9s3NJ9pEEDPUFC5Y23t lDjv4Z7FFfpm8/qq1/GELrILia5jNabQnxhwpSCU8IG3rfp0PdMF/LDiU pDPFIAgNAhjRc4D6pjIAJkG0d9ea2yTLM99es5fWWhmqm3XbPKMQhbZqB oxqU6U7VquC8ALg+To+G/7bznKrMFzcho/l0krReIBg14PiGnzmlFbB3c tKEJInL0eTF7oXxpJli0dfgqa6+tslP5qwT4KYijcTHuoW0MzoDj6u8iV g==; X-CSE-ConnectionGUID: H/9fcesfREKAig2VCO+uDg== X-CSE-MsgGUID: k/Al6E6QSFmD+eqnJgu0lQ== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="15671682" X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="15671682" 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:36 -0700 X-CSE-ConnectionGUID: 5NODjmzmQ3iWLN/XL6Cxvw== X-CSE-MsgGUID: 99XlUGDUSbKsHXGEQ5hagg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="35989180" 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:35 -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 11/17] x86/resctrl: Allocate a new bit in union mon_data_bits Date: Wed, 15 May 2024 15:23:19 -0700 Message-ID: <20240515222326.74166-12-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 When Sub-NUMA (SNC) mode is enabled the legacy monitor reporting files must report the sum of the data from all of the SNC nodes that share the L3 cache that is referenced by the monitor file. Resctrl squeezes all the attributes of these files into 32-bits so they can be stored in the "priv" field of struct kernfs_node. Steal one bit from the "evtid" field (currently 8 bits, but only three events supported by Intel) to create a new "sum" field that indicates this file must sum across SNC nodes. This bit also indicates that the domid field is the display_id to match to find which domains must be summed. Signed-off-by: Tony Luck --- arch/x86/kernel/cpu/resctrl/internal.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 498c5d240c68..c54ad12ff2b8 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -132,14 +132,19 @@ struct mon_evt { * as kernfs private data * @rid: Resource id associated with the event file * @evtid: Event id associated with the event file - * @domid: The domain to which the event file belongs + * @sum: Set when event must be summed across multiple + * domains. + * @domid: When @sum is zero this is the domain to which + * the event file belongs. When sum is one this + * is the display_id of all domains to be summed * @u: Name of the bit fields struct */ union mon_data_bits { void *priv; struct { unsigned int rid : 10; - enum resctrl_event_id evtid : 8; + enum resctrl_event_id evtid : 7; + unsigned int sum : 1; unsigned int domid : 14; } u; }; -- 2.44.0