Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp114843lqs; Mon, 4 Mar 2024 17:31:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmng0vTRIlumxShurNR310mXtDCf6R7fivEQsXwewN4fcqk9ViFViYRw5qUWTSFwlHpAn+etFXHD7zfiTQYBzmhFDNM8iCTW/CzX4nuw== X-Google-Smtp-Source: AGHT+IF2KDvamk/648qEhVdrpS6EwAfXo47AMXZO3Wni4uBezw0O/j/GM5kSw787/eBoCLhfa0KJ X-Received: by 2002:a05:6870:208:b0:21e:9df9:2596 with SMTP id j8-20020a056870020800b0021e9df92596mr452689oad.42.1709602316420; Mon, 04 Mar 2024 17:31:56 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c16-20020a631c50000000b005dc15e82c4fsi9090671pgm.170.2024.03.04.17.31.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 17:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91494-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Jx0EuE1X; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-91494-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91494-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 09517283B04 for ; Tue, 5 Mar 2024 01:31:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D90EC17C6F; Tue, 5 Mar 2024 01:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Jx0EuE1X" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 1E7B617BA0; Tue, 5 Mar 2024 01:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.20 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709602308; cv=fail; b=eUfCExbJFf5oqzAPKfsrRNFJN1PYvlKhrMjk5XzJjlseHzNFWy6qHeknwxecKcrFwGzn1lwZgRvfLQg1Pg5YhYDPivASUjv3ykFKYseSWWI42jcX1bmWXKGyCj2RFVziSm0Oc61u3xRUbqYFbJljMq8e9R1FA5sagPpvnnwJQGM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709602308; c=relaxed/simple; bh=NPis0i3mEbetZ/5l0Tj1LQGbRYYkRhqT0ZuSI2eFOGA=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=eZH1Q7oPRWSOTiQJbaUeZs+cSKNExqzmmxZq57SIxSmUMHTnWIC5yniN0/be4Nh/ztaNoJaxGuA0vcMH2Td4rAnOWl4a7qUS9zb0CJF8BVex5PXeuC83lVZ3xYOx/rpBjfVC6rX0hEt0dqtg66hktQxdD09RYPPXpc9za2FRhig= 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=Jx0EuE1X; arc=fail smtp.client-ip=198.175.65.20 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=1709602307; x=1741138307; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=NPis0i3mEbetZ/5l0Tj1LQGbRYYkRhqT0ZuSI2eFOGA=; b=Jx0EuE1XkeLI0yPSkA6p27PmhLScG8r5+gvgr0/xNRhIFOtiFN7M5qJL LzMJDTir+KN/t46zxVpSVfOSZ3JDMOKv12fXCQBiC0yNzYVVTaLaNERc4 AztNrIdqmy1vWx9Zr9nSsOxNB7vzdJE3kDJKYPb69GkoeFk98J8JUug8Q UiAXmAouUP0xQmEI9YzNza8D6nm3MB+ycE5fP84KY4F/6apTHVtav1rHb aQlh9FSShlcxh4PQTnAB5chlxgUidbpha2AP/jfh9Mmv6fWExf7BkvVwJ BVCdnzPo9ntGKSged5Oho7P5BWdZ1AH8edjgoSVL8RLB/q1j9HrTAa+1H A==; X-IronPort-AV: E=McAfee;i="6600,9927,11003"; a="4008398" X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="4008398" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 17:31:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,205,1705392000"; d="scan'208";a="9098070" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Mar 2024 17:31:46 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 4 Mar 2024 17:31:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 4 Mar 2024 17:31:45 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 4 Mar 2024 17:31:45 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 4 Mar 2024 17:31:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C9EVA681UZ8bkJdCRM6SRdyEjrOmGylTgRtLEocLHpWRhWPy2mdiZWCS9xAXFlirMzxe5iOVkhRaAuB3qjGuKwF3ypWT8Z/BAgrp+NbD6+qMctYBvza18esFaFTZmibSu8TYvHqoA91xSvzehwbVv7Jvp3EhzrchZ0/TT+uy5qBcTii47uIyl4kxOdVmNCbZLrvSGp50+tSYCbDuUYcn0U8BN7bnlwNktn78RmoNEmQf4lnAy0XD8LvdIH+1KlBh8D1+Eg87QbaiPhGHxHMwvethEUraqQsmoBuGAv8tM1zgso2Qd9ZvyXZGW+IrpRFwaaswzRPvGjhbBkSXOp43Bg== 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=Ot791j6gPWcEaJLOhADUSiO+EJ42c3KpYyVPfDF9Vo8=; b=jGHbc6P/nfqd5j/fWFw9f3IAXEhFBWV0SKru6NnxrnCxRiV82pP+jRtcAFJh+Nvk5jhPvhdQXuipjFuDvr1g9E6h+FKWKGjnIxzkCilJ5Vu5D/oOWOXgQ4lQKu8j5cSqvf3gttOCBpvqWKf52sKk7RXUZRl2Fs3w1K/X/G2pENry/vp3htJpV2LWGyXAgJE6gM6D8ARZ9Kv+bq9qYW0+TxANz0PXkHth3aOBC/OrvUiLxGYM2J+oNKXyoYCqC+iuhI3XN+KxZGQ1H6YpfvIIBlHdJGY1KMH5gszWoabV7KQbv8658GEUKLaldclbwhg97+T+xTntT6SmGFSUpO4l7g== 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 SN7PR11MB7566.namprd11.prod.outlook.com (2603:10b6:806:34d::7) by SN7PR11MB7568.namprd11.prod.outlook.com (2603:10b6:806:34e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.22; Tue, 5 Mar 2024 01:31:42 +0000 Received: from SN7PR11MB7566.namprd11.prod.outlook.com ([fe80::5abc:23ba:d55b:2c2c]) by SN7PR11MB7566.namprd11.prod.outlook.com ([fe80::5abc:23ba:d55b:2c2c%3]) with mapi id 15.20.7362.019; Tue, 5 Mar 2024 01:31:41 +0000 Message-ID: <428622f8-8dd9-40c8-8762-6bdef6d3a785@intel.com> Date: Mon, 4 Mar 2024 17:31:37 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] x86/resctrl: Pass domain to target CPU Content-Language: en-US To: "Luck, Tony" , "Yu, Fenghua" , Peter Newman , Jonathan Corbet , Shuah Khan , "x86@kernel.org" CC: Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , Drew Fustini , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "patches@lists.linux.dev" References: <20240228112215.8044-tony.luck@intel.com> <20240228193717.8170-1-tony.luck@intel.com> <12766261-26b2-4aa4-a735-c2380c4963fd@intel.com> From: Reinette Chatre In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW2PR2101CA0001.namprd21.prod.outlook.com (2603:10b6:302:1::14) To SN7PR11MB7566.namprd11.prod.outlook.com (2603:10b6:806:34d::7) 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: SN7PR11MB7566:EE_|SN7PR11MB7568:EE_ X-MS-Office365-Filtering-Correlation-Id: b9f84a55-46f7-4a83-4d52-08dc3cb40295 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hMRZSc9rdJsboFhnQ6IOQKYo7hFNCCrMYaq97zf7y9Ti9Y9ixQTxdSezEXKEvcuW1WVB/Sx2vDNHGuteOzDEN1aMnOde+9ZSwUUm0o1QeDtioBxvHcn9ECpTcA5JPvi52G3s5m03IYSrpW80uOxJnDdmTQTseR1GjjVS06MCxFFSC76K7oWlg6IkJekk5/vftONP/zM/osGbl6DJaZh340Twutii9mJ85iOsyxpl3Hp5mMwL+DQJWDiwA3HKNAPZcQb9W1EKEWaW6PJ+BdxkQgLytVlxvy5QmV22dOtn/RflbeKBpe+YXWge0aqlREAnmkzSJ2sLYGEp4a+Spl+/j95kUpko7gehI7ksI0f7kj1lpxcvVJMAyqf4mjgOyd+JCb2CgKW7hwTCLFuGhPPmSgEoen4uWPJZnOjlRjFB39//ftvWivf9x5oGgCVFjRCOeUTGxArUw0WgINRx3sb7TTrpuytUcEPY3QBQZZIykrlR4BbZqk+ZaZUZy2BVTVIvm1KF7M/JHpqpF0xQ3Q5uXRCjhV1k1AzwuQZUCgs0sAwb7TZuRBOAZMCkLJd5xlNJsfKCZQpb9OG4Q/XqnpwamXQnnwu5FGO9AESSHffwaTnBGTDAgJL73hHQ+W0AvBv548cPVVdiFoe9Ur8EumA0jaz6r2LaMdXB7TirdyyO35o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB7566.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXRHMUs0ZTh5TytlYjlpc0dXODM2b0pjVWxHT0hkNk9YemJqM2FNRG1CN0Rj?= =?utf-8?B?cEg1YTJKY0pWMGgwem1lNGNzWHpNb2Q3TWJLZk8vTUVoWlhhZzl6bWd0SnJI?= =?utf-8?B?UkhtNzdJWTlwRlBLVzJRWVk0Z2FNdENuMlVIdEJ5dW91eUxGNEE3VHJGeWpP?= =?utf-8?B?elFYRzB3R0xFMlpNczM1clpIN1BNT0ltNU9Ocjd1Vnpyekkxd0pidkVXb2lo?= =?utf-8?B?d1RYMTRzZ0RMTVZnbXhhd3NpTDZYZ0RJWDlBOE5pR2FDdU9nejc5T0tTR041?= =?utf-8?B?ME1zWjlyWDdKUDg5NnNYczFYb1BBbjNLTVZnelZnUWJWN0tyOGV4anB6Wk9a?= =?utf-8?B?ZWRyRjNVUk9MNkNtaDRPa1plUGdpMC9HQ2NEQ3B6bGtRSVhFejdVR1RpbU9O?= =?utf-8?B?YnVjZC9jTk9RR1JDb1NBQ0VhU1RDbmRxbEdBQXh4MmsxbFV6YW5hTEptaUdH?= =?utf-8?B?NlQwM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gxaWlP?= =?utf-8?B?Z09XRm9TYjdrTXRLaUlndE9FeXViaStjMERyM2REbVRUYjBtR0sxRjczYzd2?= =?utf-8?B?TTV4cStxY0N6Y1BDYjZWYk5CRFVpSFJudUhkTFY2L0J2RGlybHlja1BXTEpO?= =?utf-8?B?cEllcHJTUkFPaWpYV3B3QWh0TnZQRVNIbmp0S1pGNTVIK2I4b0I1eHBFRWo5?= =?utf-8?B?VXY4UCtFM3p4SXZNZlBaVm0veEhLRWNOcTZjRDBaMFBrSlc1Y3ZIeGZ0ZmF1?= =?utf-8?B?Y041bDJGSE9pMTJGcUthalFSM2greml6eGlVM0JsS0g3V2lobVppWjlESjU5?= =?utf-8?B?NEwyZVNIRXZmZytsMGFmWStNTjc1dndkbzZibURzaTN2RzFibk5xMjgzdDhj?= =?utf-8?B?eHJXd2M3ZlAzYVhZeTB2czJJYlBtQStqNjNmelJoWkh1TEZRYnp6Y2o0UFRp?= =?utf-8?B?ZVZyZVJNbHRWUEdGL1prNVRHbXJaKzE4NHAyckh0QWRQWlRuS2U3SmZrQkh1?= =?utf-8?B?THpCZU1pejQxLzYwR0h0S1ZkQmUyS010djZqSXdidWlyc3QwNUZzZEs3cmJG?= =?utf-8?B?c2pmZzhscHVnYnZtTDZvRk1yRktjNDI5b3I4N0NSRkFOSDErMU9oV0tJaVJY?= =?utf-8?B?SjZBTGxUSEhmd3drM1JiRkdWYUVpNDdPWmJZaHRIZFlQQUk4QUx6L0ZjL2Rp?= =?utf-8?B?a2t4N1FqL241dmpVNzNJYkhtMmY4b1VFL2kzU3ZIWUF4M0cwdUFYRkpBSWp4?= =?utf-8?B?d0NMVEx0MkpQQU5zZFNXSy80THM2SkJUZDIrdGRyOENzb0pLL2NSNWxvK1E1?= =?utf-8?B?NXc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: b9f84a55-46f7-4a83-4d52-08dc3cb40295 X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7566.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 01:31:41.7397 (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: cuRKb9V58sLkB5tZ52p/KT2NxKbb22qMRfNoaANfct3XMZRFHPo1FGf3rfQoOGn6Ze8FPwrguJ8kxul1kESXo7u9pgvrpnUder7Ugkp9vxQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7568 X-OriginatorOrg: intel.com Hi Tony, On 3/4/2024 4:17 PM, Luck, Tony wrote: >>> + cpu = cpumask_any(&d->cpu_mask); >>> >> >> cpu only needs to be assigned once. How about initializing cpu to >> nr_cpu_ids at the same time msr_param.res and msr_param.dom is >> initialized and only assign it when msr_param.res is assigned? >> I think that will be more robust. >> >> If you agree and do this then please feel free to add: >> Reviewed-by: Reinette Chatre > > Reinette, > > I agree. I'll move the assignment to "cpu" outside the CDP_NUM_TYPES > loop. > If I understand correctly that would always look for a valid "cpu" even when none is needed. Not quite what I proposed but should work. Just some wasted cycles in a non critical path. Reinette