Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2534447rda; Wed, 25 Oct 2023 05:47:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHex7HRUtys4j5sadV6KIDw08xJU772jptKCxK+SlR6ewLjfFcfUxHdfXZ/L9y/S7FVuNqK X-Received: by 2002:a0d:cbcb:0:b0:5a7:b557:6595 with SMTP id n194-20020a0dcbcb000000b005a7b5576595mr14787349ywd.21.1698238042687; Wed, 25 Oct 2023 05:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698238042; cv=none; d=google.com; s=arc-20160816; b=BS1YHHoo79gwZQYkPEzx1z1ow4k7dD8xmGGlgPLl14h7mpuL4J2WdGRMmtMLDZvnFs ofVlXoHeuVlRrcCRSVZzS/9WtveIoybELHKs6JzaBXuHsB7F+HpdmNs4dd+zPbrXNQ/i nbHu47LW8Bi/YLD8/hpXasPTC0cso67y60036tlVQGo35N5rqJD8V0Dg9ZV9oyTQ4tLA hSIYu4r6fisjVhVTJ13gzgXJ1Un9Y7XFAtEgydpqeMYd6QHPkGmzVXzAfPniYTjD/u/g 4teBu2klTZlACYeQW1PmTFVzaL6/8Iy/iqHbNCxvN7G3oobJ3gInlHn2C3SgWXwP40LK VYhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XJxjqRLgdOTokPI2dBdsj6G6P4onvQmQvzd+w/Pmuro=; fh=fdbks9cDZD3nws6fbVmPJcsGIn1evRgsQgeNrttrtE4=; b=SIZ3pU3W2xNrXLSLtUqyoLxwKOjFqq7q0XPLl2THwGXxTG7l4HSKbv4Ta39izUeC/6 03ScJ6dhnVD6I1YJeyIWkjylQjDPPxr2z3daugF6eMzCsRhLUselaGLkM8PYIlFqdCU8 mXQhhVITvn6fmFbUZU+0XylreUkZG7rvE+MphRsapWPr7LWaOAk7dE2YwHeyBm9JYj3v nlF/sFraaucL6PywuS8WMgAy8v5YmJN1D+6eNCY4Oyx5Ay38nyxRsxaxolSse4IylnwD QOKV2eZew4Le3LL5qOJ0Ak5S7y2X/WXXNMalSzzW1TtAk+v3uFAXZO/3Nz5agk23ghEw jy5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="hOFem64/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z4-20020a0df004000000b00589b2fcfbaasi10835575ywe.201.2023.10.25.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 05:47:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="hOFem64/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E943680F5F2F; Wed, 25 Oct 2023 05:47:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234911AbjJYMrM (ORCPT + 99 others); Wed, 25 Oct 2023 08:47:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbjJYMrJ (ORCPT ); Wed, 25 Oct 2023 08:47:09 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47DD181 for ; Wed, 25 Oct 2023 05:47:05 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3575826ba20so94755ab.0 for ; Wed, 25 Oct 2023 05:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698238025; x=1698842825; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XJxjqRLgdOTokPI2dBdsj6G6P4onvQmQvzd+w/Pmuro=; b=hOFem64/vgX5LavBOq/2LuRISUF2itHIKMYRE8wZEsXK1l17uTcwvP0lnnCjVRJnpw /2UiLdBV7ejqSl13fTIZArgZqGJZFnhZCcuaUYtqU6Gpa6BzAByCPJVy5Z8sENoNm2/f 0MztQPo5M441WU9uDwnQC9rgP7k5kdiqKh2fkVAhJg3Twt8FA7ufxlrAqrQSaj0JsbNz EtNsrmQAXZz5vkOIFMrh6QEInBU2QhmTUkih3XlN29cPUkBCY3ba7pDa8MHFFDqdFx4D XwJ3EJVxqhI3EFuo1N+TsPf49s7BmNi4R3iJx5a6U8/LD2rn93lzjYUo9IF8wzTUsMut Wo1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698238025; x=1698842825; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XJxjqRLgdOTokPI2dBdsj6G6P4onvQmQvzd+w/Pmuro=; b=kK63BQ4Ha/hzTzKsIH/ntegE4AtMLmsIvy6iW0ABXTLq6zmdTq7bQRyODWefBOfOlu 3NFENtQL4G2JHGy+47nubSvr5wpSULblN518n20vW4N38vlhIfIibAGbvPNa+lySLjOG z1wDYGLaKU2eHAXXevx6HOftgIpRSjgURbPHJchGBR7XHd44Qy//d68QB/SlTVXbwz7w /uo7nFolHpiVMVBRTusX5NkvzXK4VKkfpaZC32SKMAjvP+tn5TU/f4iQLaUw7fQSk0b+ 71o+1/DWTR4RofIrwi6rqfOIiPaVmTJZXJVIxDpiWo+xCdpB0CycLPMmkynu1XSGJJVD dJ+w== X-Gm-Message-State: AOJu0Yz4x2EyX8abbjLAEz1RBGOcYJ/FFMY3zzfzwxSBNSmPvmIXG40B BW5XYjfcXeJ+fOiD6RAIEostWmLcEmOAlNbeA4RAuw== X-Received: by 2002:a05:6e02:b24:b0:357:cb1a:9621 with SMTP id e4-20020a056e020b2400b00357cb1a9621mr218988ilu.10.1698238024990; Wed, 25 Oct 2023 05:47:04 -0700 (PDT) MIME-Version: 1.0 References: <20231024181600.8270-1-tony.luck@intel.com> In-Reply-To: <20231024181600.8270-1-tony.luck@intel.com> From: Peter Newman Date: Wed, 25 Oct 2023 14:46:53 +0200 Message-ID: Subject: Re: [PATCH] x86/resctrl: mba_MBps: Fall back to total b/w if local b/w unavailable To: Tony Luck Cc: Fenghua Yu , Reinette Chatre , Jonathan Corbet , Shuah Khan , x86@kernel.org, Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 05:47:20 -0700 (PDT) Hi Tony, On Tue, Oct 24, 2023 at 8:16=E2=80=AFPM Tony Luck wro= te: > --- a/arch/x86/kernel/cpu/resctrl/monitor.c > +++ b/arch/x86/kernel/cpu/resctrl/monitor.c > @@ -418,6 +418,14 @@ static int __mon_event_count(u32 rmid, struct rmid_r= ead *rr) > return 0; > } > > +static struct mbm_state *get_mbm_data(struct rdt_domain *dom_mbm, int rm= id) > +{ > + if (is_mbm_local_enabled()) > + return &dom_mbm->mbm_local[rmid]; > + > + return &dom_mbm->mbm_total[rmid]; > +} That looks very similar to the get_mbm_state() function I added to this same file recently: https://lore.kernel.org/all/20221220164132.443083-2-peternewman%40google.co= m I think the name you picked is misleadingly general. "local if available, otherwise total" seems to be a choice specific to the mbps controller. I think these functions should be reconciled a little better. Other than that, looks good. Reviewed-by: Peter Newman