Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp153rdh; Wed, 25 Oct 2023 14:07:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHts5TSAlh7V62vPm/5mYIE56jiLql3O0POdumDsAo9vkP/fblf8kV5Cfjk2fhEGRdK78Ly X-Received: by 2002:a05:6122:4581:b0:49a:1dcf:21a8 with SMTP id de1-20020a056122458100b0049a1dcf21a8mr12980940vkb.16.1698268020234; Wed, 25 Oct 2023 14:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698268020; cv=none; d=google.com; s=arc-20160816; b=Cr1pfg86PiWPvLFGQOJNIzvSGctcsehUN9Cr2cFVhNSV5EWENxIablSv9n2axfVtQ8 sBlMjE8ZaKw1Y1HggfMLbNUAi+C2xLsVRGSEMb3xl0ujWu7C8SPYiENeKWqK35ZyOCqJ vMzS5pIqWc34p8lli9093P5As5piJlIAFrbxq3HmVmrrJDqPTes/chUJtK7nQHViyqhO UOGsfrSNPw4B1+T2qqY3JYMwEMoZ/LMl932XI0MbWa61BsEWncf1M7MRv/Q+zUNpAVyv 6luj4OcYxkHVDeiVQ5L5uGxCgUIl+oFNiO1vFqjNy3QCqXPtRshbOXCNY8HZ2u4zFzZU Xw1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YfKUQfUVw2J0FwzBs8kRktoJX+okfytV+T+B1kRuBio=; fh=fdbks9cDZD3nws6fbVmPJcsGIn1evRgsQgeNrttrtE4=; b=avbXtThZiAlGGQc6mZincCsGhtnmnNaK8DsQHPKarOhNDu8xNw814EDNxblrgVG3Ug JJoSsxEX0eKJxOcsk7NvfciTxrHP1gwhiaygykk41IRyPf2VojPDwDbcY/2PDdLQ83N6 WmQ/+CWwOyL35GoudrSOQVGm/q7k7R/K0hsG14dJDk1na3MJhH4NWlYMIR8x8+HieNFR m239DwCwKWEKqyh7YrDQJiz/CaNtq7VBNVWtHTeVoepB2nh0Z7a71R8D03gx+fvvU/BD TlDZxZND+6FZyXiZS3gExCP8qIyOevCR3QmZepxMDmiN/OgoIpjfO3lvjeuVV6A9zlZC VdGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Uzjc4i9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y13-20020ac85f4d000000b00419576c2d0bsi8585023qta.548.2023.10.25.14.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Uzjc4i9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 9917B802A00A; Wed, 25 Oct 2023 14:06:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbjJYVGg (ORCPT + 99 others); Wed, 25 Oct 2023 17:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJYVGf (ORCPT ); Wed, 25 Oct 2023 17:06:35 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 448BD136 for ; Wed, 25 Oct 2023 14:06:32 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-3575826ba20so26855ab.0 for ; Wed, 25 Oct 2023 14:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698267991; x=1698872791; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YfKUQfUVw2J0FwzBs8kRktoJX+okfytV+T+B1kRuBio=; b=Uzjc4i9Rw9syaHUHEzJ+R+rqVahROI2kY8UxdD3VMs7SMIA2KCDXIThzUVtRv2HuzT mRmt8kqehxt6FnN0hViy7d27MvNaJFzEx8DDXiizgt19Mz5As48mp9iZJ6eBFQETkXUG acS25QB184H3tszqJ5l4CmXeSmwxOVi+q4Mtc3vtFr//B2S8RzMBXjcyYfuSyx3cxGeq ZE7DgTHyJMzbr4UwEaz37oRDXd7T1B6s85IO8QypyWb1rCHCAf6Uh1GFetRR90YzL3sw tANFInQnsP52z0T9Jtcq51/sp5Z4Vz9esA1N+ucXctSf7ofeAcdxF3r0WhZHc0Bvj4wF DhZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698267991; x=1698872791; h=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=YfKUQfUVw2J0FwzBs8kRktoJX+okfytV+T+B1kRuBio=; b=FQt0mzKCaH4E8AVOvw0ZqU3oNvItXqJmOkaAtVcpM4hyhcAC1bV1jqgkty2HiWEisO nG51lQLcfeRnT6xQak4+vxLcso8mSJuuPJ58WNjHAx8vKN2axNpOK0R07Hv3HjcPwbip SPTWzsVnfBOcDk0BQJpTsWltMGWkFHrMFLnzcoVazEnuMvC+c8mtYDApMs+gS2CuXJbQ lGw5BwyYIp1Q4BdLzH0TYVlFXdqUENhpIP9cEbltARqoHB4mE86Bwx8wHPjZwApqF0Hy 53xgNHqLRB0Cp2xUxtyiFhE6BoxZ3vSVZk9VKKW4HcCY9+BvvU1oHLX2UsoEK79Vb6xk wMfQ== X-Gm-Message-State: AOJu0YyvDon6XI6I/ocBh3EQ9ylo/fcO/QakYCZnAPuqVIoa0lFdx4ax /45wLybakJ6AWSqevrRPuoWW2yxnz4cRoOvyWmu6ZA== X-Received: by 2002:a05:6e02:b24:b0:357:cb1a:9621 with SMTP id e4-20020a056e020b2400b00357cb1a9621mr375512ilu.10.1698267991544; Wed, 25 Oct 2023 14:06:31 -0700 (PDT) MIME-Version: 1.0 References: <20231024181600.8270-1-tony.luck@intel.com> In-Reply-To: From: Peter Newman Date: Wed, 25 Oct 2023 23:06:20 +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" 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 14:06:51 -0700 (PDT) Hi Tony, On Wed, Oct 25, 2023, 21:38 Tony Luck wrote: > > On Wed, Oct 25, 2023 at 02:46:53PM +0200, Peter Newman wrote: > > > > +static struct mbm_state *get_mbm_data(struct rdt_domain *dom_mbm, int rmid) > > > +{ > > > + 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.com > > > > 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. > > > > Peter (and Babu, who made the same point about get_mbm_state(). > > Do you want to see your function extended to do the "pick an MBM event?" What I meant was I think it would be enough to just give the function you added a name that's more specific to the Mbps controller use case. For example, get_mba_sc_mbm_state(). It's only problematic that you added a function with an equivalent name to an existing function that does something different. -Peter