Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp770769rdh; Thu, 26 Oct 2023 15:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsBP5xyjx7GDXZF9GPiUyIf686P7bfLsnCcQYa64N7JitH9YANfTZWzQYmoU38wctUEEZ5 X-Received: by 2002:a81:764b:0:b0:583:741c:5fe6 with SMTP id j11-20020a81764b000000b00583741c5fe6mr658909ywk.52.1698360076807; Thu, 26 Oct 2023 15:41:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698360076; cv=pass; d=google.com; s=arc-20160816; b=McsxnNfTmMfvvyUmJmfq0kGbKxznE6xsT9kiDMjH5qu/lYSrWTe1hfIG+3AWP+Xiwg BBYi3gQZYZfxOccQL7sdHQCXGH+d3J14yGL+JBSws6k/9895d2ko87SP9rp4mQgEmVLE ceEVDa0qDpsu8EbAn34e20Cw1S8ZpIM/wFbvmwYW1+kIvhDW3zEBM/Z9sr7bDJOpKgGZ wTs2gq6b+67i5Vvqj+ZvPT+QuNC9HX3MZ3cXka8/F912G5qDvoGtDL2MYNEQKlV2Kcdj Zv8EcsYvorjbutjx64lviUK0Yl34lETh8ASbaAmSFBvctsvxftUm/muEe/qf/ESseS26 b46w== 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 :in-reply-to:from:references:cc:to:content-language:subject:reply-to :user-agent:date:message-id:dkim-signature; bh=d3Tda/ZvMRc4T5IM9oz76YDeinAIKHlQ+eTTKBDrLD4=; fh=fwcTHqsZ2Rant85STRKGol9Gq9z4u7AUkrZgA413m0s=; b=UnrPfvQPdCI7kESEI+491QoD4vaZQ3X4OvRuXQ/YWJKgfG07TphYNZ4U3TmPkk+sWw 01TkJ6tl3cQg6tKmCZ2X5i2d8uYtyVwQV7JXhXdnACCVSSLwRkSRkp0gfqX95uyvgUPg 4YSH9I/3bdTqeffDlxLYNIlTqTL8fS8bp7O/PYn2ERg4rKMWyFZU0kSqx14bOLs49kHx CZd8qDwzypRZbN7IsbB1jJIy8RbXy90vyOl/lbniDAI0krrTSo14a8DupDivhs8WjJ3B R25TyzyCdD7xUIY8wwcrvb4lC+TqEKfNgmrIPGXaZYYjUvFCTvYeWvotd2upiANNEyNV FAFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5Vqvqt4+; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h1-20020a0dc501000000b005a44337e277si379794ywd.524.2023.10.26.15.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5Vqvqt4+; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 65037837D954; Thu, 26 Oct 2023 15:40:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344860AbjJZWkf (ORCPT + 99 others); Thu, 26 Oct 2023 18:40:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjJZWkd (ORCPT ); Thu, 26 Oct 2023 18:40:33 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C43CC; Thu, 26 Oct 2023 15:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVXhjvoWUFp5dR1hmjqTYWcEP/Sf/i94aoQ4+VugAkqWKpdSLSkQdZtjeV+cafmzoo3lW2WVXyl/oAEdLKclns33z6UIOyH/LtITqFS6RmjDDZAnD0ntUPvSEjttRYCz232uuJcPL5OJdznDw+cZkNeRXAueHkS1HG4VsIKd3hBOuiUrJs2PE5/fqdEs654RIWJ4R6SY+WxwbErnQAHSIvowdRcHCaaGE1my1iRSHMdlA4d6iMNw2+UWgtnEMv4le9VrPyW+n1gzLLefgzAuWqUdbfZ/cot2l4wzq4K3aLrycbnLc5YEwYKhqp1rerSTzpK/0Z3sgkCu2Y1tNmiVpg== 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=d3Tda/ZvMRc4T5IM9oz76YDeinAIKHlQ+eTTKBDrLD4=; b=l1u8XhSC1DJdEjoR19RqlTIzTxNwxs3R6ayAeXXom3lEs9rTabkdDXNun0kaqrusRxiexKpvt0X/ks+kiYCJJsN2OlpuCn+bsBWE4cposuJgLuxXb5PTCM7+RefS05MWKlFiXf2u70CyqLGaMqFA0JVjOLd/6an0I3VgrWJBnIdwfJgPJeDy878d0asNuIOFaR6MYP7j87shs76TZr8k/1fomKyd+UstRv7SoXzpe7YbpVAaR6woiHcli6Xh3RoXlvDmCDV3TuwhMCIk53ZohS/v7RyQinH7TjSvZ2AtUG//qwRFT4XvWh0FNbUBBPJNCfaOSjQAMFR+Y0Vvb5qGlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d3Tda/ZvMRc4T5IM9oz76YDeinAIKHlQ+eTTKBDrLD4=; b=5Vqvqt4+s1QWBKGPRK3H6de3v0jH1gpql2GCCqqZV7d+6F5/W21Dwi6/sBMkzRd04G05u+UFtKT6N8Ke72Qo0aFXVrQihsM6AIAweH1vfl+ttOLExm1O27+0FeoSOCNNYplWvdlMGmtyPjvvcUdWYoaBehDD7QxqnFX+t14IcIU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by MW3PR12MB4524.namprd12.prod.outlook.com (2603:10b6:303:2d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Thu, 26 Oct 2023 22:40:28 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::1e4c:5da0:33ed:ff3a]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::1e4c:5da0:33ed:ff3a%7]) with mapi id 15.20.6933.019; Thu, 26 Oct 2023 22:40:28 +0000 Message-ID: Date: Thu, 26 Oct 2023 17:40:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Reply-To: babu.moger@amd.com Subject: Re: [PATCH v3] x86/resctrl: mba_MBps: Fall back to total b/w if local b/w unavailable Content-Language: en-US To: Tony Luck , Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , x86@kernel.org Cc: Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev References: <20231025235046.12940-1-tony.luck@intel.com> <20231026200214.16017-1-tony.luck@intel.com> From: "Moger, Babu" In-Reply-To: <20231026200214.16017-1-tony.luck@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA1PR03CA0003.namprd03.prod.outlook.com (2603:10b6:806:2d3::14) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|MW3PR12MB4524:EE_ X-MS-Office365-Filtering-Correlation-Id: 757abfe3-0d73-4ae2-8895-08dbd6748d5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kF3CpZxC3CUvLtYOJhoxs2EQypF+YohB6Iu5V6pAYnxm9fTtDpfl5RCZDhLxWSUv4/GrpYgYKolLtmnD3hXDPfz/G69BHvDZ4cxaPlZzovQ+nLPHBfVNpWM7rd86tPnT3q9o4z5Ys/u/jbKrjik769DFLniVxyGdQIi0+I43xAD337Lkcb9CSO8nPX2dSwlCoZn/Ohha9QUJchcnGc/4vdqz9SRUhdFxyFXI2ApAdrE+9HREhk8VuuXEz65ubPVUvGzxI+cfvfd6NCa0jDmF+bu8tSFtYs/uxl7rotEPL22U3Gq/aEJzHPUzsj2TpT5e0aWDZnPY1ZlbpFNuRPvstf5LJLD9Y9Guc5ZW16FRDFhgo5NgZ+oPYQPnMHH34xOANWi0WruXY2vCe7YmC6cAOp1x22/1Ma6xSZEirOWbkAJ3CzTumWCbxwOU/hCdci3i7dmi805/BoR3OzTrP19G//r2U1cUyVJ2vB1V0kgSVwABRt6F8ta5RJH3lPrAIuKkthdk7lhjouEjmBeI/6McEJn6Lpnp0MbkXNRBb8AV2XR7UaQNjlfCcwGB8yIKTOrCRZSh6Z+jRzhWQfyxoIbEWXRoYQxTs4V5LppRDBvLgtAJSfcL3ougPt1Lk4r6TzMx7Y6oWlwG5ok7z/CZriZRqQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(26005)(110136005)(478600001)(6512007)(316002)(6506007)(54906003)(66946007)(66476007)(66556008)(36756003)(6666004)(2616005)(6486002)(7416002)(83380400001)(38100700002)(8676002)(8936002)(4326008)(2906002)(31686004)(5660300002)(41300700001)(53546011)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SEtobDI0VGorOEhnVFVnK0dhaGtEUDYwYnVzODVRUnVEOGxiZzRCK1ZXQjEx?= =?utf-8?B?dDhNdEhJMW5iSDlZbTNBSDFXTGJFQUFIclhGa3RoRTZodUVNNnYvZ2dyK1dG?= =?utf-8?B?MmkwZWlRVDV0ekFHWWNmaGFjYi9SeWFkeHcyc2JtblRIZlhIU3ZDTjMrdzJY?= =?utf-8?B?dTRvQlFydjh3MDcvdE42eEZwS1VJam92OER0emNkOE1IdER2Q3J6dEdNcVNY?= =?utf-8?B?eVlqOUg1K003R3RNRjJGbU16czNMQlFFRjB0ZHVhVERLWld6M3oza0FNOER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ySFVnbE1wd3lmek5YWmV2MXllYlQz?= =?utf-8?Q?UKeg=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 757abfe3-0d73-4ae2-8895-08dbd6748d5f X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2023 22:40:28.0713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 13bQGhv9OCKaQMuIlLK28wV+l5eIOHhu/ziLsKS/hJDXhYS7cuuMpMnP6NOetBQW X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4524 X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 15:40:45 -0700 (PDT) Hi Tony, On 10/26/2023 3:02 PM, Tony Luck wrote: > On Intel the various resource director technology (RDT) features are all > orthogonal and independently enumerated. Thus it is possible to have > a system that provides "total" memory bandwidth measurements without > providing "local" bandwidth measurements. > > If local bandwidth measurement is not available, do not give up on > providing the "mba_MBps" feedback option completely, make the code fall > back to using total bandwidth. > > Signed-off-by: Tony Luck > --- > Change since v2: > > Babu doesn't like the global variable. So here's a version without it. > > Note that my preference is still the v2 version. But as I tell newbies > to Linux "Your job isn't to get YOUR patch upstream. You job is to get > the problem fixed.". So taking my own advice I don't really mind > whether v2 or v3 is applied. Hmm. I like v3 better. Few minor comments below. > > arch/x86/kernel/cpu/resctrl/monitor.c | 43 ++++++++++++++++++-------- > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- > 2 files changed, 31 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c > index f136ac046851..29e86310677d 100644 > --- a/arch/x86/kernel/cpu/resctrl/monitor.c > +++ b/arch/x86/kernel/cpu/resctrl/monitor.c > @@ -418,6 +418,20 @@ static int __mon_event_count(u32 rmid, struct rmid_read *rr) > return 0; > } > > +/* > + * For legacy compatibility use the local memory bandwidth to drive > + * the mba_MBps feedback control loop. But on platforms that do not > + * provide the local event fall back to use the total bandwidth event > + * instead. > + */ > +static enum resctrl_event_id pick_mba_mbps_event(void) > +{ > + if (is_mbm_local_enabled()) > + return QOS_L3_MBM_LOCAL_EVENT_ID; > + > + return QOS_L3_MBM_TOTAL_EVENT_ID; > +} > + > /* > * mbm_bw_count() - Update bw count from values previously read by > * __mon_event_count(). > @@ -431,9 +445,11 @@ static int __mon_event_count(u32 rmid, struct rmid_read *rr) > */ > static void mbm_bw_count(u32 rmid, struct rmid_read *rr) > { > - struct mbm_state *m = &rr->d->mbm_local[rmid]; > + enum resctrl_event_id mba_mbps_evt_id = pick_mba_mbps_event(); How about evt_id instead of mba_mbps_evt_id? It seems pretty mouthful for temp variable. > u64 cur_bw, bytes, cur_bytes; > + struct mbm_state *m; > > + m = get_mbm_state(rr->d, rmid, mba_mbps_evt_id); > cur_bytes = rr->val; > bytes = cur_bytes - m->prev_bw_bytes; > m->prev_bw_bytes = cur_bytes; > @@ -518,6 +534,7 @@ void mon_event_count(void *info) > */ > static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) > { > + enum resctrl_event_id mba_mbps_evt_id = pick_mba_mbps_event(); same comment as above. > u32 closid, rmid, cur_msr_val, new_msr_val; > struct mbm_state *pmbm_data, *cmbm_data; > u32 cur_bw, delta_bw, user_bw; > @@ -526,14 +543,14 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) > struct list_head *head; > struct rdtgroup *entry; > > - if (!is_mbm_local_enabled()) > + if (!is_mbm_enabled()) > return; > > r_mba = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; > > closid = rgrp->closid; > rmid = rgrp->mon.rmid; > - pmbm_data = &dom_mbm->mbm_local[rmid]; > + pmbm_data = get_mbm_state(dom_mbm, rmid, mba_mbps_evt_id); > > dom_mba = get_domain_from_cpu(smp_processor_id(), r_mba); > if (!dom_mba) { > @@ -553,7 +570,7 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) > */ > head = &rgrp->mon.crdtgrp_list; > list_for_each_entry(entry, head, mon.crdtgrp_list) { > - cmbm_data = &dom_mbm->mbm_local[entry->mon.rmid]; > + cmbm_data = get_mbm_state(dom_mbm, entry->mon.rmid, mba_mbps_evt_id); > cur_bw += cmbm_data->prev_bw; > delta_bw += cmbm_data->delta_bw; > } > @@ -595,7 +612,7 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm) > */ > pmbm_data->delta_comp = true; > list_for_each_entry(entry, head, mon.crdtgrp_list) { > - cmbm_data = &dom_mbm->mbm_local[entry->mon.rmid]; > + cmbm_data = get_mbm_state(dom_mbm, entry->mon.rmid, mba_mbps_evt_id); > cmbm_data->delta_comp = true; > } > } > @@ -621,15 +638,15 @@ static void mbm_update(struct rdt_resource *r, struct rdt_domain *d, int rmid) > rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID; > rr.val = 0; > __mon_event_count(rmid, &rr); > - > - /* > - * Call the MBA software controller only for the > - * control groups and when user has enabled > - * the software controller explicitly. > - */ > - if (is_mba_sc(NULL)) > - mbm_bw_count(rmid, &rr); > } > + > + /* > + * Call the MBA software controller only for the > + * control groups and when user has enabled > + * the software controller explicitly. > + */ > + if (is_mba_sc(NULL)) > + mbm_bw_count(rmid, &rr); > } > > /* > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 69a1de92384a..0c4f8a1b8df0 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -2294,7 +2294,7 @@ static bool supports_mba_mbps(void) > { > struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; > > - return (is_mbm_local_enabled() && > + return (is_mbm_enabled() && > r->alloc_capable && is_mba_linear()); > } > Otherwise looks good to me. Thanks Babu