Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1030777pxb; Wed, 1 Sep 2021 15:46:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT6y83U1FFOg5Ibsvmx1Lf9eMTuFfLkFNA1Jxe744zhz0lBuQRyZJy4kefRcZAO409dkK5 X-Received: by 2002:a17:907:76e5:: with SMTP id kg5mr213158ejc.474.1630536402196; Wed, 01 Sep 2021 15:46:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630536402; cv=pass; d=google.com; s=arc-20160816; b=P5A2vajYmbJwCpSnM0RGajrgrXJTz/vKboqZKxGOlmy2Ik0iq8tsB4tRzTwy56ju9Z UEODX5qrUnnamAhq5Tu1d2AONz2L7iIdkGhpIe+oa7faYnVV/bWyK9wGy2hqtFLenOXB Rg4dPyYTKJ6MfCQsx5VPYncNxa9Dh8+aeFeKUle5IkIH8354tKfaIikkvJ4YtqPx3CO5 lBRVFzAewrWKLu6wbEHg969XzyzAduVu8Dj0D2VnynmH0+EPWI74a8KizpAOnJO2KN4G ZatacDuKW8kueFfM8hc76rrPWFCAbXuFkpuw/YbOB2GsBuGohhLmiRLqpiITFnk8ajIj 5qdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=S1ZPlGIPvK4WfstIUxeuvVwGI11Ro24n0lbZvw4eaE4=; b=EJ1DE3SmqUtmlrRHXfMi1uUUTHZIdnUwNnyLUuc4GpoYuYFMe9LN3mqC8hd/xoR9m6 Hq5mq1RF0xcUbXBXG0aKbCoRH/004DGXsQrsqD/2R2ksSDav7GY50RP6uwbNnPnU5rM6 m4hO+rFeyPvNPN6qK07Qkkv1OxwpdJ5Whjs9KfrEIE5iSGE8X8m7zCS3sQLOfb7UKqjj ffeVThgVmQuFJrv59ydjQk9+FFbbEZvjl48dIYtvwNaehhzgeABM7x2vnTDeYbPtBFIK AWbh2GKYe87yxuVhZyAHDHAl5LbLmvNTxgemgvTV+kSGuW9bvwpdxeKKJW/RYZ8JteKo MPlw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=M73RBoBu; 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-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si1139427ejo.13.2021.09.01.15.46.19; Wed, 01 Sep 2021 15:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=M73RBoBu; 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-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344318AbhIAV0j (ORCPT + 99 others); Wed, 1 Sep 2021 17:26:39 -0400 Received: from mga12.intel.com ([192.55.52.136]:37829 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343918AbhIAV0i (ORCPT ); Wed, 1 Sep 2021 17:26:38 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10094"; a="198426050" X-IronPort-AV: E=Sophos;i="5.84,370,1620716400"; d="scan'208";a="198426050" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2021 14:25:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,370,1620716400"; d="scan'208";a="476355028" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga008.jf.intel.com with ESMTP; 01 Sep 2021 14:25:38 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 1 Sep 2021 14:25:38 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 1 Sep 2021 14:25:38 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2242.12 via Frontend Transport; Wed, 1 Sep 2021 14:25:38 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) 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.2242.10; Wed, 1 Sep 2021 14:25:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a36rAp/FwWZ4td5Jjpw6fGt+L4Usz8HolkrBagyVZ0HidUPcDGedjoBB45ZTfw/lO7Vnh9ZEdi5IcKcfh86Tts4QraQS+QKZo5FwadLXF/Zt4qWDWfdpYetPiPJzWexv5SYS280b9uEnLELjE04OnfJdjvO424RuuiYI3jJZy/fp5+eJX61KDnVwRcwlOFPvjqVB5byNQhM1+VzIrnhbAN5RB/pfhbXcS7ofR1LgqPiYEG2QCKVE0enBO/QO3r2Tfv030m0FXDy/4wCFjEdDALOMCmsTn9RHWQmeokcvAA1HK2iUhmrFuyjdqLcrekQ0jy+JRzpikdf9CDgkQ1Vgnw== 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-SenderADCheck; bh=S1ZPlGIPvK4WfstIUxeuvVwGI11Ro24n0lbZvw4eaE4=; b=gHBYiuSi1U6ER4WBh1skH4b4s37Ug9C1Xm2sGpOXeyvIwqQ7pZTgUqYtDqUm/KYioX6qhEsqXsBE3yD52MUXcspRlr9OOISAAKJUl0y95+xU2oqe5lb5xVYoNFTKc7pangzMdXV4YWElmEFeHXW6tlztNMk6zsFJtN+QFi2TWrddmMbujB83cDZcIqxMW6AydfKZ+AxWpWLI2xJ2hmTE8Y477ZMG2STGrAEpKNzHlVbMaXQnWGbpt9WCjPB14seBHGQCySB8b+MtcQLzmsH1VuWzhHOs4kvtEAh8HOozVbVgyoqL6l4t/TOkrHng0zDZyoVew3oqucZgCWyOgVjWXw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S1ZPlGIPvK4WfstIUxeuvVwGI11Ro24n0lbZvw4eaE4=; b=M73RBoBuC8VvgKvb6+Z1RVajekEMvrTuGl1vZfesPP2mX1SI21ub8RTtl4oY+F2mCkDWVyfCjrruAp2sWlwiJOdwi+NmTV3PUMSx2HUoycWvFa1PUuBi1YJSMHZTB3rDyMpduN8qngoKAnubBIfLJs35P6RbwVODKNVgOHnTcbY= Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; Received: from BN0PR11MB5744.namprd11.prod.outlook.com (2603:10b6:408:166::16) by BN6PR1101MB2258.namprd11.prod.outlook.com (2603:10b6:405:5b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Wed, 1 Sep 2021 21:25:31 +0000 Received: from BN0PR11MB5744.namprd11.prod.outlook.com ([fe80::d47c:525:2aef:f6a]) by BN0PR11MB5744.namprd11.prod.outlook.com ([fe80::d47c:525:2aef:f6a%3]) with mapi id 15.20.4478.019; Wed, 1 Sep 2021 21:25:31 +0000 Subject: Re: [PATCH v1 06/20] x86/resctrl: Switch over to the resctrl mbps_val list To: James Morse , , CC: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , , Jamie Iles , "D Scott Phillips OS" , , References: <20210729223610.29373-1-james.morse@arm.com> <20210729223610.29373-7-james.morse@arm.com> From: Reinette Chatre Message-ID: <5be446b6-d6f6-dacb-4368-7c1e7aedc6cf@intel.com> Date: Wed, 1 Sep 2021 14:25:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 In-Reply-To: <20210729223610.29373-7-james.morse@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4P223CA0026.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::31) To BN0PR11MB5744.namprd11.prod.outlook.com (2603:10b6:408:166::16) MIME-Version: 1.0 Received: from [192.168.1.217] (71.238.111.198) by MW4P223CA0026.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 21:25:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d8f7b57-cf37-46c2-099d-08d96d8f06dd X-MS-TrafficTypeDiagnostic: BN6PR1101MB2258: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gqVF2rtXS6UW+0zJuBNZBCmSA/3foHdtFobm4N+7l1ALQtnghrZyyHHhxwsNjUS0GKSOhu/3YXitv+tcWWnBf89Yv4WRHrbsuxP0DvSurQsUEoawLcRkzWPi8Kq+fERkx87rDBXR9Gifjfg72lQKIBvQF5CPl/w1oaJngqcQIsRqB3ioK2hzqgrsaVPb0p/IYtcNsR90UJzptk5ZRVQhPG6iLzj+e3vhMejdfyjRtsdG2FFehiWcVjJcrcowgM32r50ZuhbO4t7r1x3TiBzQjP3ipp55YZ/WYPbYrHPhb++YhhOMRyVPXQJHnjuow+Z9L4JBr3pG0IWYroS2bToFDRwPBtOQJ+bKvWAQaoAs8O6aHl+GMkWs/iPIzDmer2dOt8u0suGJeQSQ/7cExdoehPNjUYmDrP/cjrj0sRiMVQ5V6J1BhoS3OGMu6Z2tnTraURV7/WjSkMqVa4wDCTdrebKIbRKqyczx+YnNv+SP1kvPQdg+801rGATvKyr6Qb3xgqQ/nnap6Jzbmn2JLCsqi1mTJcyXTnqRi344KG9qNennf5mqy65hYDyv7k/hfNFAb2dYUOOqvgSlFzdn9YTvMmeICmffAg2sTz7XVdCOmXB/H6dIY0fz5z22hB56hePuDQBUtp6VwgoT6V1qtw793AAytt2WnkjP/o9qwf9ir9IT5OXtApaS+9gJDb469IugAooudE4CF3wrf1x79FX+nq2ptVWAgb+CoARaupv7RNk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR11MB5744.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(136003)(396003)(39860400002)(376002)(86362001)(26005)(6486002)(36756003)(2906002)(5660300002)(7416002)(186003)(53546011)(44832011)(316002)(8676002)(4326008)(66476007)(38100700002)(956004)(83380400001)(2616005)(6666004)(31696002)(478600001)(16576012)(66556008)(31686004)(8936002)(66946007)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MzlMdlRYNno1REloSE8xa0hnbzMxeHVJVnhka0tiUDhORzZhZHEwZzg3Ujg3?= =?utf-8?B?TnBRdG9NSWtkZ2UvNmpjVFh1SXMrVnRxdEJhQUhycWk0RXlhK2ZGYklUenFM?= =?utf-8?B?VGJlQWRQay91L250U1VXakFlblFaUzZZZUQzanR6MTA1NXdqZVV4RnArdkg3?= =?utf-8?B?N1N5ZGNLZkdBcEoreVBGbmI5Vk54TkVKV05OVGQvMlNVbnNSa25XSkdVZmxU?= =?utf-8?B?bmVsYjFDSUxHRnRkVUxjenRjYThOb0R5YVRwZWQ3bXE4ZTYzTk4zVlpXMjcv?= =?utf-8?B?WlRqa1drcWpOM05XTXlQOU96dUROU0E0R2w4MStkdERKWFk5dlBQVzJHcVEv?= =?utf-8?B?ck5yNGVmSk5IRjFPV1UzUDBPNHpYMmw5L3dEMUlycWt0cXVQN29heGVmWE1o?= =?utf-8?B?N0NXME9kQkdRSUx3cE1HbjVrbGkzV1l6YkpRc2cvaWtiSGYxMURtd1Z1MHk0?= =?utf-8?B?QTczbHdlTTZac0luc1dqNlB3b05FUE0zWWtlL2JaQVlpM0hZNm40M0dG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rUkpTc2tDeTJIVVVl?= =?utf-8?B?SmllRVBoM0JCTVZMRkxTQ3A1RkkxWStWZDcyOHlwUVJ0TGw5WnJocVdPUXF4?= =?utf-8?B?UHZhRUhvT2psWnozLzhIWGhINnIvRWZMWnBSN2RwTmhyVDh3QXRXejU5em9V?= =?utf-8?B?djU3NXFRQXdSbHBSMGFqNWNQZ1ZvVXlWaWdFQ2lhTmxEQkJuRVd0MmVVUCt2?= =?utf-8?B?R21DeHUxZ2d3ZkQ2Z1g0eE5QZVhmTHlBekVaNThDUHV4ZXdMc1ltQjFLVlVP?= =?utf-8?B?bkFhQ2Z0S3R4MVMvdTJWejVaejcvdll4WlhQSnFUZTZOeGd2Mk9VdTBqQkI4?= =?utf-8?Q?37gaPq20dntzk7S10HfnH8KzbXkorDhZHG7n46/?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8d8f7b57-cf37-46c2-099d-08d96d8f06dd X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5744.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 21:25:31.3541 (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: DV8TTK/ilR/mxZ8JR/e4+X919pPHnBtkXb4GjGiff++NDYma5bmhl4lAw8vFU7iB/D+ucuccXBnzcOpXjYIxVk+4y/Muiw0gRWX02QyHt8A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2258 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, On 7/29/2021 3:35 PM, James Morse wrote: > Updates to resctrl's software controller follow the same path as > other configuration updates, but they don't modify the hardware state. > rdtgroup_schemata_write() uses parse_line() and the resource's > ctrlval_parse function to stage the configuration. > resctrl_arch_update_domains() then updates the mbps_val[] array > instead, and resctrl_arch_update_domains() skips the rdt_ctrl_update() > call that would update hardware. > > This complicates the interface between resctrl's filesystem parts > and architecture specific code. It should be possible for mba_sc > to be completely implemented by the filesystem parts of resctrl. This > would allow it to work on a second architecture with no additional code. > > Change parse_bw() to write the configuration value directly to the > mba_sc[] array in the domain structure. Change rdtgroup_schemata_write() > to skip the call to resctrl_arch_update_domains(), meaning all the > mba_sc specific code in resctrl_arch_update_domains() can be removed. > On the read-side, show_doms() and update_mba_bw() are changed to read > the mba_sc[] array from the domain structure. With this, > resctrl_arch_get_config() no longer needs to consider mba_sc resources. > > Change parse_bw() to write these values directly, meaning > rdtgroup_schemata_write() never needs to call update_domains() > for mba_sc resources. The above paragraph seems to contain duplicate information from the paragraph that precedes it. > > Get show_doms() to test is_mba_sc() and retrieve the value > directly, instead of using get_config() for the hardware value. > > This means the arch code's resctrl_arch_get_config() and > resctrl_arch_update_domains() no longer need to be aware of > mba_sc, and we can get rid of the update_mba_bw() code that > reaches into the hw_dom to get the msr value. > > Signed-off-by: James Morse > --- ... > @@ -406,6 +406,14 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, > > list_for_each_entry(s, &resctrl_schema_all, list) { > r = s->res; > + > + /* > + * Writes to mba_sc resources update the software controller, > + * not the control msr. > + */ > + if (is_mba_sc(r)) > + continue; > + A few resources can be updated in a single write to the schemata file. It is thus possible to update the cache allocation resource as well as memory bandwidth allocation in a single write. As I understand this change in this scenario all configuration updates will be skipped, not just the memory bandwidth allocation ones. > ret = resctrl_arch_update_domains(r, rdtgrp->closid); > if (ret) > goto out; Reinette