Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2666947rda; Wed, 25 Oct 2023 09:02:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPIIAOIvT7l8DwFY9hCuYL1mAJHh7QI+6GAl83brKjnzDkxKW+zUWmzMD7no6OiwQWKK6q X-Received: by 2002:a81:6f57:0:b0:583:a3ab:b950 with SMTP id k84-20020a816f57000000b00583a3abb950mr13908052ywc.50.1698249728390; Wed, 25 Oct 2023 09:02:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698249728; cv=pass; d=google.com; s=arc-20160816; b=V6wshWNv2r8Dw7OEfvOTrTz3/GhyQr+HdPc1UOirQZJu0p+0ONkfDlzNBcQDt+JzUX XDBwL7LF+qLL2ysFRTRJdp5Cb/ilE7xeFz3I0Wyl3Z2wxJCu21MYNlJvtXZMX87I0AMM xbjFydyfhsYb1VE7pdlM9dCikvnajzQr7JEYd2+IkCrps1baf1ZmGC4TJ5uBzRfcRtCz pR6dqQz9ZI4cjocG2xgUP5H4x+oXyDPGp2VuR8CRepYgHlO5jHQlkcKCHv8pybMs3im5 u8NzfVknhRSPDvAvkd6FwVfUyx/HyV2r8amOZLWmT48Yp9zv7HAY4/ITCkp2pyFsIQuB Ue4Q== 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:content-language:references:cc:to:subject:reply-to :user-agent:date:message-id:dkim-signature; bh=gLnW964FuWBfeeXovqMYPYNZvlfbKmGkHp81NxqgNTA=; fh=rK+Hu+HC6DGu3tIrGiNQbG4d2pfolaY9JvXDptuWHHA=; b=VHnXQoOxBeqgp+PFFmI1r2do5P3hT/h4C/mGXyYxbfTNwbN62IPandp9o8dyOY7Llc 3VqH99otFyrCYi8Ku3xTZRfY9nzV7QkFg7f7GcVZIe31NqI+rZ3qvmed1ehLxA3iH80S 2/wcjwpgjhv7Bk8r0iCNmvUAzExcl8GwSpWteeZds7+E7ziDauCN/ez4A9g8wtnaXDN3 zHdv6oghqKbFACenQi6LGf2cmsZ2r82hUNYNWBrF9gegTw7peib00EZOeHjY33xRyVKt dpIDu0icJFTHovIUYZ70SdRoha0hjkehqOqL+WG4VKCqd3q2nNEzQDiWymOrPp6eAz7X cBwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="p1n/GnLw"; 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.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id r80-20020a0de853000000b0056ce2ff50fcsi10851897ywe.411.2023.10.25.09.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 09:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="p1n/GnLw"; 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.34 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 howler.vger.email (Postfix) with ESMTP id 7DF9E80CBDE2; Wed, 25 Oct 2023 09:01:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234709AbjJYQBc (ORCPT + 99 others); Wed, 25 Oct 2023 12:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjJYQBb (ORCPT ); Wed, 25 Oct 2023 12:01:31 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D88136; Wed, 25 Oct 2023 09:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=myQMNlCmJZsf55SnHMWkuvFWU59j+tnbKdfjjg8R1gZbG11vOyjpLZgZj4UGdyTKGIZNxZEQRV9dETGa+qFxkqOHrnMnfqy7wHyVtD9wdWcT4DYTLyTiJBGy8W1e2d3jS6cxyet16umw02gFucGyKfpugknLcN+0+qYZm0smJC2tQXs7ZBaL1nJJq4rr1BJK2CRHfsfk2b5t7KLUwwKWwHWRQ98ARUbWbg8Q20TWE6+umxHqEPgYq9Xff6KzySe9MTsqW66oibyZBPyymm7mOSwjeYw0TF87tEq6qyb7wrBb4MdusXrF1ovcatRW6XhPIaUPgZHA7AtqE2ZL0icolQ== 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=gLnW964FuWBfeeXovqMYPYNZvlfbKmGkHp81NxqgNTA=; b=Jwu7JcK8SkCnbeJCDeOStuUETamQMcT4+dMkWXwHVKo0t6qqtMN52cA+OSIHd1+MfybTRULDT38ZDveHzVZP2Q6Z4s3ucw0UkHmt9w/VEv2MBrOLr4OJOZnMzZ4QaLnrM67x4jIPrFe/5tD9jE8YMzxJGTfvrXA3QLHYvoFGu/FZy3dLWouLx3uv9vGiPeJPLwt/OdPT5cYejgTOjDsPXECrGWeuyKpFkphPOj2EoTpExiAORnN5zX5yh719xXGN+sY7jttViEHCo7LDQ+e0cgJWYrIT6T2v6LxlwLiNoJM54ZjzIfR8Ogo2otaBHRXaMiHT36tywu2KJ3fhDmFSMw== 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=gLnW964FuWBfeeXovqMYPYNZvlfbKmGkHp81NxqgNTA=; b=p1n/GnLwJUwEUVhb8InrAEtEItwypB4xlRdJRUeLyT6epSjCC3L3OKPZt2BKF4A2pvZj39at/1hKVZNJWyAshEhp3Vw+gmrAHKAI8jxy2rlde7nju+oH4xtCHZIkqjCV04CrDybGLlP/VmAYcvxAH0XMXjhyTG6ODzT+Dr3E8uk= 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 IA1PR12MB6329.namprd12.prod.outlook.com (2603:10b6:208:3e5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Wed, 25 Oct 2023 16:01:26 +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; Wed, 25 Oct 2023 16:01:25 +0000 Message-ID: <74a372a8-6908-4f9f-a79d-febeb6136379@amd.com> Date: Wed, 25 Oct 2023 11:01:22 -0500 User-Agent: Mozilla Thunderbird Reply-To: babu.moger@amd.com Subject: Re: [PATCH] x86/resctrl: mba_MBps: Fall back to total b/w if local b/w unavailable To: "Luck, Tony" , "Moger, Babu" , "Yu, Fenghua" , "Chatre, Reinette" , Peter Newman , Jonathan Corbet , Shuah Khan , "x86@kernel.org" Cc: Shaopeng Tan , James Morse , Jamie Iles , Randy Dunlap , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "patches@lists.linux.dev" References: <20231024181600.8270-1-tony.luck@intel.com> <2504daf3-16fa-9474-e9c5-cd6aa99d4776@amd.com> Content-Language: en-US From: "Moger, Babu" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR18CA0016.namprd18.prod.outlook.com (2603:10b6:806:f3::20) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|IA1PR12MB6329:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c03b596-1264-4d3d-6937-08dbd573a400 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6iQLPpYax2PQQl6Uf90OrfmcScYsQWeN+wTrsVj3cxPMlI7afCdGkUsYewAC0YJE05bQlXhFaFrqZUW/D2rEVyWNKDXJIo20g1cJo94FS8N1Wc81PGe/vyxrN/FDf1T9gBVPQZpd0CmlR+rbKN6jjFdG8KOhQyEPbYOglX+vSL5I3AKW/fImpkX1HhPkvTlT/Que/Yk+T3qwgvpxXjQGAkE3axwjf3sXhDk0O+UtjyKnBBIbzKnQD2BlVxKxkXaaNPLxNr8uwzTsfY1T/JEdqF3tTKuHxsxjp+uqV8zYSPwT5r3sXgOvzXuGv6ijkfP4TaniOy2X3VlpY4WZs0GiC2iL2UqbfD6LmU6VqO1G//x29X+X2wrcw/Lxgt5fDMeMo7L/qYME8kC4EIf1RWdr7eaDpnSlohXYao6nzjzeRqF8gZSVZrgz0Xw7t4NIGOF2KOJXIc3nwom+CVAKwTycipTtxoO8zZc+rq3GhaKkBpdHdJT4yM18UQHxHjhKzy6o10LAQpKF9B7IQTzxWkgJsKMve45Eu8ndgKA/uz9iQPj2xIPmLZrI2yzRDTKThbk8IDqlIudZymT6DV4mv4xZ42JfieAFUhMiIsKTNq1fz0A635s4Jif2z2YGet23et90uKMBjTI3O6uehC+9z5bv8O3cxt2u79NSnzxQcDtD5rQ= 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)(39860400002)(366004)(136003)(396003)(346002)(376002)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(110136005)(6506007)(6666004)(53546011)(8676002)(7416002)(4326008)(41300700001)(478600001)(8936002)(2906002)(5660300002)(3450700001)(6486002)(54906003)(66556008)(6512007)(66476007)(316002)(66946007)(86362001)(31696002)(2616005)(38100700002)(921008)(26005)(31686004)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bzJBcTIrWDBBdkZiUml3NUhLTTFqSmVFOUNQb3pUVTArU1liVnZhd1p3b0s4?= =?utf-8?B?S2FPM3ppVTAvM2FDNnlJeHJQbWJ1UlFYSWoxTlVlQUNpSEw4bEtkeUF3aHFq?= =?utf-8?B?eXlBa3FhK09wQStVdjRRUUlDMngrZE53R2xFQmJieFZDYUpVQUpmMGJKSFVM?= =?utf-8?B?OXhwNkRjclN1V1p6ckFDQmpGYXMrNUZHTjZxaWpMU3FDR2VFN2dOS0tyUDFw?= =?utf-8?B?Z29IdWZVSUpjM09DN1FLdHRIcS8vTlg2dnNxRU9mMG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XenZlUGJyclRxekhxQTN2TVN0MzF3NEtkMkNwMS9TN2ZHR05iTTZGZFJO?= =?utf-8?Q?i+t0=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c03b596-1264-4d3d-6937-08dbd573a400 X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 16:01:25.4018 (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: /kdkCeFpyI/fVAwCayNOa+cYXVqlUhn2NgIY1mJ4SgHUJNMQLqtYldtJC2czIqun X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6329 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 25 Oct 2023 09:01:42 -0700 (PDT) Hi Tony, On 10/24/23 18:43, Luck, Tony wrote: >> Is this customer requirement ? > > Any customer using the mba_MBps feedback mount option will need this > on platforms that don't support local bandwidth measurement. > >> What do you mean by " If local bandwidth measurement is not available" ? >> Is the hardware supports only total bandwidth and not local? > > There's going to be an Intel CPU that will only provide "total" bandwidth. ok. Why dont you use get_mbm_state which is already available instead of writing another function(get_mbm_data). You can pass evtid, rmid, domain information. Decide the evtid based on what is available. I think that will make code simpler. > > The CPUID enumeration in (CPUID.(EAX=0FH, ECX=1H) ).EDX{2} > will be "0" indicating that the local mbm monitor event is not supported. > >> It can get real ugly if we try to handle one special case. > > Hard to predict the future (I didn't see this coming, or I'd have had Vikas > implement the fallback in the original mba_MBps code). But I don't believe > this will be a one-off special case. > > I'm also wondering why this feedback loop picked "local" rather than "total". > I dug into the e-mail archives, and I don't see any discussion. There's just > an RFC series, and then the v2 series was applied with a few small suggestions > from Thomas to make things cleaner.. May be MSR write which feedback loop does only has local effect. This will be interesting to know. -- Thanks Babu Moger