Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1068751rwi; Thu, 27 Oct 2022 10:43:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5J6b72Bh0Uu/Awi3lge6FR79y9wrp5cHvcZUkFePggkkENdifkJm9m0XBIkIKGhlfmP4n6 X-Received: by 2002:a17:90b:1c82:b0:1ee:eb41:b141 with SMTP id oo2-20020a17090b1c8200b001eeeb41b141mr11771866pjb.143.1666892638804; Thu, 27 Oct 2022 10:43:58 -0700 (PDT) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a056a001a8f00b0056301324a24si2726442pfv.133.2022.10.27.10.43.46; Thu, 27 Oct 2022 10:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lWjhmXuF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235810AbiJ0RgQ (ORCPT + 99 others); Thu, 27 Oct 2022 13:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235586AbiJ0RgM (ORCPT ); Thu, 27 Oct 2022 13:36:12 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613A3ACA3F for ; Thu, 27 Oct 2022 10:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666892170; x=1698428170; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=9t/l/OzlcptUa0Lh916xmpxEBB6nxjs8J2IgCIFDAjQ=; b=lWjhmXuFLThs8XCP08FjWHSGxe+a157vEOgjZ71K+l7d9RzcbqnmlGtA Xg4QeZb9//D8kwWt3lb32IjKZCs9ALpYIGDs5qwfufpboVOz5QJCL+hzu DH4w94dQlZx3QBfAhzaU/CXhbDhqDrlSciwGKO+oXPVVyn0xRZeJWt+ZA 0g9YkuJvF6ldfmSHxH4V7IcK4VB/Hf+lVyOcupslkvcAcU7PPRgZ2/2l0 IJ8yDc1EpK4w71OuwrR5SU7Ob4lapfGP/dO1xT8jrc5y0lIjvxZ4bGH14 mRYq7IqucqPOJSnGsdeRnqlC+TLEfQ9Q8U6f+Ny+gaGepLZDr+lVwPUQ1 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="394608906" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="394608906" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 10:36:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="663704594" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="663704594" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 27 Oct 2022 10:36:09 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2375.31; Thu, 27 Oct 2022 10:36:09 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 27 Oct 2022 10:36:08 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 27 Oct 2022 10:36:08 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 27 Oct 2022 10:36:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZNDLfNtnRnxgVpLWI7Pdi3US6G0iAo1POBMjW0b8T0hEzIb5k5d3Twa5L2nOtBsq1E4AilUAlCUFtzotYMFs8kQgbX+lXnzOoTEzO4D3WV5dPtBxtYYDJtg6m3GNVlPF/Zb0Oq1+/sdAZELHZL+Jx7wuxlrInaDAOpE1k6hDJMyYEFzsyNJg3NEFx6rT8P88xpRGfOTD7jeYXoTtlWlfEZ6qUsn+fCGIwUO+26O8ma9GT+LWi/SgGIYH0knpPRZ8mU0pCkgauzcbsWP59qvHrOq2GoFfL6+m5KscBblyPdBacQKz5JgF+AeMBSRCrZrkhT69vo6PQrRBtyb+JJy1w== 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=MfphHS+4JnrQv1CmqeEjU/hb7dTzbKKAvLRISkaGyFU=; b=awtGKvfvnLeXsaEfNMI9wV+F0gQvJthcpHf0dImMiprcfx6R3Do9GpBqc23B49cbPYDaFK2MqSipqgia/5/H4VKI7+bKPWxgIMEIaBM2wnK13TTxDofMIgPXxn7YVssxyQ6iU2DplSyhe/bE0gkPXbj0CWT1JcNTyZu1T2kZDL60y0GfbB5sP+5oECFT1EREH5KQxPKaIql8VEjE5pjtUlVjnBYV35+jnFvmmDcM1ezZ6PZgiLT7SCHF1WOO+5thcZdotCh58kYAzZApo8N1WkkFh7SdrrFchQFajHRee5E7YOR7bxZN4wEIUyxVaSIdxpKKpKcEuU5Zrd8gIx6hcA== 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 CY4PR11MB1862.namprd11.prod.outlook.com (2603:10b6:903:124::18) by SN7PR11MB6750.namprd11.prod.outlook.com (2603:10b6:806:266::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Thu, 27 Oct 2022 17:36:01 +0000 Received: from CY4PR11MB1862.namprd11.prod.outlook.com ([fe80::207e:ab0b:9e29:6a4b]) by CY4PR11MB1862.namprd11.prod.outlook.com ([fe80::207e:ab0b:9e29:6a4b%12]) with mapi id 15.20.5746.028; Thu, 27 Oct 2022 17:36:00 +0000 Message-ID: <08c0e91a-a17a-5dad-0638-800a4db5034f@intel.com> Date: Thu, 27 Oct 2022 10:35:56 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.4.0 Subject: Re: [RFD] resctrl: reassigning a running container's CTRL_MON group Content-Language: en-US To: Peter Newman CC: James Morse , Tony Luck , "Yu, Fenghua" , "Eranian, Stephane" , "linux-kernel@vger.kernel.org" , "Thomas Gleixner" , Babu Moger , "Gaurang Upasani" References: <81a7b4f6-fbb5-380e-532d-f2c1fc49b515@intel.com> <76bb4dc9-ab7c-4cb6-d1bf-26436c88c6e2@arm.com> <835d769b-3662-7be5-dcdd-804cb1f3999a@arm.com> <715e4123-fdb3-a71e-4069-91d16a56a308@arm.com> <317b4a96-f28d-aab5-57cc-f0222b7e4901@intel.com> From: Reinette Chatre In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0025.namprd03.prod.outlook.com (2603:10b6:a03:33a::30) To CY4PR11MB1862.namprd11.prod.outlook.com (2603:10b6:903:124::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR11MB1862:EE_|SN7PR11MB6750:EE_ X-MS-Office365-Filtering-Correlation-Id: e718ef5b-f459-403e-0ae1-08dab841b638 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pBl6WP/LFkLM+hQ33luMPp+6InxvC6KFV5N4wLSEpDUTKzYcRL/cGBxRblI6EL4AZ/2saM9h0Us1Yo0NF2DNAlRXK/f7gFFalGTdkCEBpkabXQbgMbl6KBHLi3/WlWAWvvk8yRlYAfCHoIqJzqcGa46xsX6+/3vztp3lq+HAqY+Xd684Of8ysAgAJgNe+a2EG+MoYbPBvC975V9n+w0qH4K1BKKEMEtBiUDGX6JiAoasgBbiKhgPSugB6YVUROgDlG/ISN2eCgmdJgbFU793jBHAkNgyD2nqNKbjdqr3HDQvuE3+SnwLvcH2golDYq9C9DoQyJekJfgfn9ums8kINalfm1l11rfZoPUtpsLPnrfAFzP2HF1vctyHunBilUtgV3ZL9PjqqvJuEQgWmcTfw3ttHUz0sCqdQEhfijYlQgFANMzWciJpCwyNxhUyxNlL9MN+OuBzK7ZVJLlGxw+HR4AKVZNKaEbSBCxtcyx7lVA64/eWwNMsbSiC9DjYZoh6hI62cVUA3QTkjYiSJIN5jgxtjExscUOZcJ+nIgEbUlBoEctpfIRGIhRcz1nvMiqL8Lffi/THXxIWqMro9Zv6DlBynb8v5SPndFK1MTIHQof1ZNFmqXep934SQ4Zqpx+acxhUM+8JCfDaKc4+0QkUPlhS4FybWMTou+chA1hqv5hF6mrkF6bTIV5PCmA02k9ezJlRHps4v9r5I4+YHgyXGsG2uXqGJmzVbvM4nmdD70Xsi5gABnMb7rWmh3QIjfCsI5/oFubFa6w0Oy2ilcMuqG8rHCv3FikKjYwS0vkhF48= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1862.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199015)(186003)(2906002)(83380400001)(31686004)(26005)(41300700001)(86362001)(6506007)(6512007)(53546011)(4326008)(8676002)(36756003)(31696002)(82960400001)(66476007)(66946007)(2616005)(316002)(5660300002)(38100700002)(54906003)(6916009)(44832011)(6486002)(66556008)(6666004)(8936002)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QnNHbExZNEw2WDI1bkl1V1ZuVmVjaTZWTnMyMnVWTERDKzUwbmJUQU9idDJ0?= =?utf-8?B?N3NOTW01a2F4TDM4ZnRTQ1FJSWRqUHVFdkVmUkFTa0o4bVBSVTVtUlJDZEFs?= =?utf-8?B?bktjR1FOZDVkbHdqaTQxOVc3SzRvQ2FKcDdzb0ltNm1nRkVoeTh0MTNsYVE5?= =?utf-8?B?N2UzOWJ4VzBaT0FQT0YxSGZBeGxrVVBIZ003SmFIYmd3NENNMWdxTURvTHpn?= =?utf-8?B?QlBkbWJXN3U1SEhhT1pFSkNFS0JEN3pybDdDMGpkZkorRlhkdGFxaE1OWFJP?= =?utf-8?B?UHJSZDF2K1F6dHJ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?utf-8?B?b05Qc3c4RkduV0JKdVh0dzRNTkpLQWZhVTh6NGtKeUorRE9nSFJxeVlMM0VX?= =?utf-8?B?dVE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: e718ef5b-f459-403e-0ae1-08dab841b638 X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1862.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 17:35:59.8982 (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: xgLSpm2sY98svTDaatVDLwX9ZhXwP2RV/sz7nhu+GaUlgB25JWTTPEh0GEMLjGljNoKQefFLRhQgoXwmgvjbQsLYM8wicsJUfVBgNdL5ZzA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6750 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 10/27/2022 12:56 AM, Peter Newman wrote: > On Wed, Oct 26, 2022 at 11:12 PM Reinette Chatre > wrote: >> The original concern is "the stores to t->closid and t->rmid could be >> reordered with the task_curr(t) and task_cpu(t) reads which follow". I can see >> that issue. Have you considered using the compiler barrier, barrier(), instead? >> From what I understand it will prevent the compiler from moving the memory accesses. >> This is what is currently done in __rdtgroup_move_task() and could be done here also? > > A memory system (including those on x86) is allowed to reorder a store with a > later load, in addition to the compiler. > > Also because the locations in question can be concurrently accessed by another > CPU, a compiler barrier would not be sufficient. This is hard. Regarding the concurrent access from another CPU it seems that task_rq_lock() is available to prevent races with schedule(). Using this may be able to prevent task_curr(t) changing during this time and thus the local reordering may not be a problem. I am not familiar with task_rq_lock() though, surely there are many details to consider in this area. Reinette