From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 A5FC118F2EE; Wed, 26 Jun 2024 16:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.10 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420370; cv=fail; b=ZrOQqignEmKSNiQ4sGmKRwMoJaGWQNcKmZPwPY5AHwI7/27E2iSsrGt0YXPSeGYhPsoIJ2QXwRK+m4wIh/6bHsjyHwru9ZmSmK1RJyGPDt3EbAZzy+jnh0mIyAkJQZdoGJyGlySCHvHlvIHN/2aAMp08YeOrFaqqQl1txXKkha4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719420370; c=relaxed/simple; bh=/KpWss3Qken5HHyyywxW3xXGix2HItUz96bHtnaU5wE=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=RyKaTM5P3WzSjFfe9/3XTsP+ZAsW7eOoU+xJLHv7g6YScDGcWo0/fDbYsDW19S/jnviv1KiySltsg7TF1r7JSSjL5NUmdpvFi59X+IlGhjXYWVJoXWRDnrB3dAXPHTRdrSfv/j40jHxE+1/OouKDYHhwsNy42sfT7g2etAxEJms= ARC-Authentication-Results:i=2; 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=BLS9CXsN; arc=fail smtp.client-ip=198.175.65.10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BLS9CXsN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719420368; x=1750956368; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=/KpWss3Qken5HHyyywxW3xXGix2HItUz96bHtnaU5wE=; b=BLS9CXsNn5SpVksktEdoe4DtZ5/YMMKsRubC/9ZeEndlPHjlFj2U8Q/r P367FsQ5rQZ4BZ0Vsud8Owgg/GjacncZ7hIf8dMpIs292aRUSF+S9Ssto Cemo1UiSKkXqisXn2PPA6GBZevFyCiASDVlFmvQpLVNmq1Re+YO/aOo57 TCgIG0eKjOQIQz3+cKWxBImI6GRGMWkuZm3cq1QZUXO17YGhjYfTD0nRc UIYGlYxwCquy1H8k9DP87/0BA3PhR079YtIJ6Xn4vywvtW+SvfDl24rWE NB+IEpVdJnAbsurPG+6XrJTcv0w7S61syc7xamc+AylCoSJ+Znmu5bdue g==; X-CSE-ConnectionGUID: 8FfAbRn8QIee2Sx1iTs5lA== X-CSE-MsgGUID: /GE3UMhnTyyFqUGP05Zfnw== X-IronPort-AV: E=McAfee;i="6700,10204,11115"; a="33961202" X-IronPort-AV: E=Sophos;i="6.08,267,1712646000"; d="scan'208";a="33961202" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 09:46:08 -0700 X-CSE-ConnectionGUID: VfL05s4QSrqVeBO4fQ02/g== X-CSE-MsgGUID: +/asmKLYSyqeBVlYRbDXbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,267,1712646000"; d="scan'208";a="67283956" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Jun 2024 09:46:08 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 26 Jun 2024 09:46:07 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d8htTn3TCiou+2gqBG1ePr3JUeV9ltahwNU7HBXgXpdUZd3uNu+fdhttI/d3fDWxeGE3EHV/ZX5OfreD/wgMeAGocxAlDQyIGCRaHgu5Lmvh7ExvdKDZPKkxTGPJao0adTvJG0iNLg3EOom1y1lfwlk39lMm3EwgIYn45PS16gaLTzYonA3Wr+gLskB3XmBVD/uLqUqfRD08riE3HXCaFwxVIV31jZaDSFLsXwFSfSXOZM+bKbBKaxCX6v4Ifl4hpfcbi9Huv0uwqhAc+/1lvTmAzBMS/mCQxT2FjTOMzWp45yFivjE/qyo8nDkNfzmNvawVzdnaioQLy+OP31oztA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EnYrBIEO6oJH1DgRzsfX+Oq2t27TPFlS7ZrcuLlY2kE=; b=oWnMA0LqlyMv8bUTDxmWtF4X0Z4GbZ6EP0mWtTgxu/PXKyTb7Ua78QPyS8UddeRKABgewVGri50mfXVOgkHH4jRMZwvCsNWMSd3NQVsg9EhwoZFOC2Ozz8agWKuQJ64Lax7EFr8s9KqS10jiVb+ok15p0nrT3R5587HbuDbkZpBFAjfH13t9XMRKGW5h9US6QthcldkymL0qwOMUo8gVhuyuLTXLLX6nbxPzQfeoXPbyAxsSv0Xhq+rbqt6DgbrdBP0SHJXKXez41QI3//VojkT/7A0wTf5ulldKvZXLRjtF0VOrxbxcauH1JVnEJ2AazJ7demnz5I9Db/fjLf0G7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by CH3PR11MB7895.namprd11.prod.outlook.com (2603:10b6:610:12f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.34; Wed, 26 Jun 2024 16:46:04 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7698.025; Wed, 26 Jun 2024 16:46:04 +0000 Message-ID: <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com> Date: Wed, 26 Jun 2024 09:46:01 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled To: Maciej Wieczor-Retman CC: , , , , , References: <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com> <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com> From: Reinette Chatre Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4P222CA0006.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::11) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|CH3PR11MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: cc16ef0f-9415-4121-8c7d-08dc95ff77c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230038|376012|1800799022|366014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WjNEZ2VwNkRwVFRKbldCTnBGVzRvaExSNDVnY3RtMkhObDMwT0lLMmFMZmYz?= =?utf-8?B?TElWWWtmMFhJV0FSUVNhUnRTbG1TNTdMUWEydHZ0UEc0ZnlzOFBHWGErNHFk?= =?utf-8?B?OEh6aFhlVUozUDVuc0tmczVDVWovNU1ZVGF1bnc4NWpoNWJCcVpJaGJ5Szhk?= =?utf-8?B?MW1mdGhpaXR1RC9iNytxQmVRT2pVNkdzeloxdVB1Y2cwdlBJSTlUVXFrN2h0?= =?utf-8?B?dmE2SFhlRkFoQzA4clIvaGN1K2ovUWtmWkxXYmtaZEtGRlJ1SStIZXBKb3lu?= =?utf-8?B?NGNrT1FwZHBuK1cyaFFqVzRvWHcxWmF2dmg3aTQxeVVJRXFqWEgvRXpETUJ4?= =?utf-8?B?dUdMa3pWY2IrZXkrYkdTZG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=?utf-8?B?ckk4N3pHZEJwdkJvUkdCdldlSXBFWDdoZDB2SXdPMGtKamZkR3R5K3AyVVRs?= =?utf-8?B?N09UTEw2bHBFNmhWTFRrcE9Hb0dGMyszdkw5MnM1bFZBWkJRKzh5QVVvRUpt?= =?utf-8?B?aHdvb3RkZVhWaERFT1d6WTJzaTl5VXU3bmFVQS9xa0xmeDh2Nm1JWXhudjV1?= =?utf-8?B?SllmTTRPdmw3Y252YVRmMERUUEltYnBMZGpHcDUrTWNKYnd5cW4vWlB2azFC?= =?utf-8?B?R0ZNdHJNK1BYam84dDlKdFc3Qjl5aWtqVS9xMXpwZGVuak9TanJvZkxUbjN3?= =?utf-8?B?K21yUzBBVDJhODg2T29IM1U0a1A1L1hSdHZzK0F2T0x3dDRvLzJxT2VLMGRY?= =?utf-8?B?KzBDc3EyeGtBN2RRRDRjSTdST05BaktqZWxITEpsZWtZaW9Ic0lPcXZBN2Yy?= =?utf-8?Q?KKFnuEKeZl+0eyuSYv/S?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230038)(376012)(1800799022)(366014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDc4RkdiV05VSWFSdHJHdHRhMlh0WTVvQWxvZWoyOXh6cUpPa3B4djFuY1JN?= =?utf-8?B?UGw0Y2QxZTZ2TFBiL3VxbWNUQzg5RVlUSWdZaGVXOHRXQkdFa2E1VjcwcHFr?= =?utf-8?B?emNxSVo4OFo2MVU5MkdQaEprVWlIZDM5SkdSSTh5d00yaFNMK0VoRVR6NW50?= =?utf-8?B?d2hFMml1UmkvRHlMTDhZbVNUUTY4aHF3NVRiM3BQYUhNeTFhckk3QWlYVDA4?= =?utf-8?B?REUrTkhnMklVNE4rQXhRNVFk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-8?B?aXc3U09tS0ZWdlhRbjJWYW8wVXEwUm4yTkxBRUQ3c0pFRkM0WEdjemdGQ1Yr?= =?utf-8?B?NXV0TVVvTDgzQ2xqSUpLWE4yMlNsV0hIKzFJOGhld3JGNU00d05QTERjek1Y?= =?utf-8?B?ZUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: cc16ef0f-9415-4121-8c7d-08dc95ff77c2 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 16:46:03.9700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X35lsgTWNEjd3eYjev7UCfS6n+2gQ1YDa6+mIPFNuZnUNJ5zMxU/uez3NwGMfQV11OgzAbMJSmyhBuBOaNupnArcjL9Pgms/deKuwYsY9f8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7895 X-OriginatorOrg: intel.com Hi Maciej, On 6/26/24 12:09 AM, Maciej Wieczor-Retman wrote: > Hello!, > > On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote: >> Hi Maciej, >> >> On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote: >>> Hello, >>> sorry it took me so long to get back to this. I prepared the next version with >>> your comments applied and Tony's replies taken into account. >> >> Thank you very much for sticking with this. >> >>> >>> I wanted to briefly discuss this before posting: >>> >>> On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote: >>>> On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote: >>>>> + return 1; >>>>> + } >>>>> + >>>>> + for (i = 1; i <= MAX_SNC ; i++) { >>>>> + if (i * node_cpus >= cache_cpus) >>>>> + return i; >>>>> + } >>>> >>>> This is not obvious to me. From the function comments this seems to address the >>>> scenarios when CPUs from other nodes are offline. It is not clear to me how >>>> this loop addresses this. For example, let's say there are four SNC nodes >>>> associated with a cache and only the node0 CPUs are online. The above would >>>> detect this as "1", not "4", if I read this right? >>>> >>>> I wonder if it may not be easier to just follow what the kernel does >>>> (in the new version). >>>> User space can learn the number of online and present CPUs from >>>> /sys/devices/system/cpu/online and /sys/devices/system/cpu/present >>>> respectively. A simple string compare of the contents can be used to >>>> determine if they are identical and a warning can be printed if they are not. >>>> With a warning when accurate detection cannot be done the simple >>>> check will do. >>>> >>>> Could you please add an informational message indicating how many SNC nodes >>>> were indeed detected? >>> >>> Should the information "how many SNC nodes are detected?" get printed every time >>> (by which I mean at the end of CMT and MBM tests) or only when we get the error >>> "SNC enabled but kernel doesn't support it" happens? Of course in the first case >>> if there is only 1 node detected nothing would be printed to avoid noise. >> >> I agree that it is not needed to print something about SNC if it is disabled. >> hmmm ... so SNC impacts every test but it is only detected by default during CAT >> and CMT test, with MBA and MBM "detection" only triggered if the test fails? > > Yes, snc_ways() ran before starting CAT and CMT to adjust cache size variable. > And then after CAT,CMT,MBM and MBA if the return value indicated failure. > >> >> What if the "SNC detection" is moved to be within run_single_test() but instead of >> repeating the detection from scratch every time it rather works like get_vendor() >> where the full detection is only done on first attempt? run_single_test() can detect if >> SNC is enabled and (if number of SNC nodes > 1) print an informational message >> that is inherited by all tests. >> Any test that needs to know the number of SNC nodes can continue to use the >> same function used for detection (that only does actual detection once). >> >> What do you think? > > I think running the detection once at the start and then reusing the results is > a good idea. You're proposing adding a value (global or passed through all the > tests) that would get initialized on the first run_single_test()? I was thinking about a solution similar to get_vendor() that uses a static local variable. A global variable could work also. > And then the SNC status (if enabled) + a warning if the detection could be wrong > (because of the online/present cpus ratio) would happen before the test runs? I do not think this was part of previous tests, but yes, this is a concern where a warning would be helpful. > On the warning placement I think it should be moved out of being printed only on > failure. I did some experiments using "chcpu" to enable/disable cores and then > run selftests. They didn't have any problems succeeding even though SNC > detection detected different mode every time (I added a printf() around the line I am not surprised here since there has not been much tuning of the CAT test. > that cache size is modified to show what SNC mode is detected). While I > understand these tests shouldn't fail since they just use a different portion of > the cache I think the user should be informed it's not really NUMA aware if the > detection was wrong: Seems like there are two warnings to consider: (a) SNC detection may be wrong. (b) If SNC is enabled and kernel does not support SNC then the tests may fail. For (a) I think that it is possible to know when SNC detection may be wrong. A test similar to the kernel test that compares the "online" and "present" CPUs [1] can be used. The /sys/devices/system/cpu/online and /sys/devices/system/cpu/present files are available for this. A simpler way may be to just print a warning if /sys/devices/system/cpu/offline is not empty and set the number of SNC nodes to 1. Instead, a new "snc_unreliable" global can be set that can be used to print additional information during test failure. I do think that it is fair to print all the SNC details during detection but I am concerned that those messages will be out of sight during test failures and I thus do think it is useful to have extra information during test failure. Reinette [1] https://lore.kernel.org/lkml/20240621223859.43471-18-tony.luck@intel.com/