Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2186590rwd; Fri, 2 Jun 2023 06:11:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5p/rRsZpR0KObeNW///NIfe3h90M9vlrgzFXw4gOWdW0z/Sf02mDB/1YADmB0UtUeGrg9y X-Received: by 2002:a05:6a00:b95:b0:64f:4d1d:32ba with SMTP id g21-20020a056a000b9500b0064f4d1d32bamr10161360pfj.5.1685711487033; Fri, 02 Jun 2023 06:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685711487; cv=none; d=google.com; s=arc-20160816; b=hthbw1Eiw0pOepXkqG9m/6BK4XzH1A17f/1cQKjEy29MSifDKMGhC5DkOFdWDkKt2c 3iYVs3X4V6JospX8KinxeHW4gR08GzlpGQtpXrP4t3+jjDWDmEl8b0jGzo+3LFi6U/6G dFtj+VhEX9tRk4irx9oocEnQhCv8EETLrwHhorxjT3YYIdWhdJTIgM1D8+9ES7b00PnB hI2PWw1lgfsoiG8I3OEeYfqEi6fRTAXn9ERP1hORChU+WxMamNxPPT4Xz5+2Xsmrym9K Y2QMoXubXI04h8/8ee4qv8L6VwriPUGbxd1khFuaj1jAj1iYGzpdnyJUpwhTuR9CaSki 0EuA== 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=6JCTvniZ12mr+m+9b8RtDFwDRmM7sUAnvwKqhY7Pabw=; b=eIOciVq16iUvemIPC3zTP6nnEw43MAcl137eIAEHROC9RJp7itEDPgfKbiO+8LnhFT jhIwyBclc+2V3erIzTANfuNLoCu2cEbwz99Ze8EGjhn0bWd7qiQJnBf0w99KXBDqR5ql RG1Y+xudtE8mMdyZT+LI83RfamGZnRu43ftHkB0q9sB0nHhxqPBcqCyvVboLBOCFy9ix YVqoq8Ets/SG6r7JsubBtflZzzyP3MgvFaBfmX2gc/XfpNG68Xs1xVCG4lKA0D26Vll7 PT+JpfYzCHYXMxLPAkqj6O2lcGk0COIZmvnZ8/OaTr1v3eJgP+fT7H5nVvs+AzGB7JHR FEuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=sm13f6K2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020aa79f4b000000b00640f7f287dcsi743341pfr.174.2023.06.02.06.11.14; Fri, 02 Jun 2023 06:11:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=sm13f6K2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235288AbjFBMmz (ORCPT + 99 others); Fri, 2 Jun 2023 08:42:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233875AbjFBMmy (ORCPT ); Fri, 2 Jun 2023 08:42:54 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 922A8180 for ; Fri, 2 Jun 2023 05:42:53 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-3f6c6320d4eso147801cf.1 for ; Fri, 02 Jun 2023 05:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685709772; x=1688301772; 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=6JCTvniZ12mr+m+9b8RtDFwDRmM7sUAnvwKqhY7Pabw=; b=sm13f6K2f8Fb1b27q819RtEObuwO6Dn+jj3C81BOG8A0rgXFLXg02UJxkBnqunFpEQ MwvFGvQBhy7JhvE+/50TABk2lqxlCmVlB/OjHzw+rYI7vwSthAihNrIwVEgmcy5fr+F4 nf/idPVXHFhINwULTGV5eeid5SKHI4AlQwczeTmvTaYMbFfPIvFWirhr9JHap2dqr7nr xFm2mxTCbsHXgndL95QoNq7t/hgXtMW3Hj/sMHz5KWwE5XAPn7fgkoDanPXGQxHYbbv8 YTCx1JSG4Fj8TChtKRbnR6bJkkN2qonAFIkrikDd372VB6jj/iV4Kpjhk6lFj53wr3gc UE/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685709772; x=1688301772; 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=6JCTvniZ12mr+m+9b8RtDFwDRmM7sUAnvwKqhY7Pabw=; b=ClqXts7bxDLec6woADkdRIHJ2Y6vRELxGRX57JUUUHXt7hKwcMRxTeq2anWwpLOyj4 Zp+YXDygBOfk2+YP910XQH3Uq7CfzQ472xj6F4PpFEBodz+5BGolzol0rDzk5XyOxoV2 /0FzKBo/Jol4xDVTg8Rozo38hsLkJnakXQh5fPB5m8OluFRpDNPQ8xUZA05+qIhhO74d kLpHPW3DDG1y2heHvYiq+XLOlxV9lGDTpC1o7cz+a/S4FAdcgSx/uzG1oExcFJb2N5yI LFTuQ09hJjl0QGgUUDeKPIZeb71+LNBtHuwu07Hwg7lylxQSwzznWsia2nCG2KuSLhhP OkkA== X-Gm-Message-State: AC+VfDypceTWly9ra1etaXdkdyE5TZVW5YJf48quNWya41YT6I3JiTyQ c2yOCOFlfuwA7KOK+lH7s3wwupdNloDrhHNjkNBgEA== X-Received: by 2002:a05:622a:91:b0:3f8:1db6:201c with SMTP id o17-20020a05622a009100b003f81db6201cmr161246qtw.13.1685709772498; Fri, 02 Jun 2023 05:42:52 -0700 (PDT) MIME-Version: 1.0 References: <20230421141723.2405942-1-peternewman@google.com> <20230421141723.2405942-9-peternewman@google.com> In-Reply-To: From: Peter Newman Date: Fri, 2 Jun 2023 14:42:41 +0200 Message-ID: Subject: Re: [PATCH v1 8/9] x86/resctrl: Use mbm_update() to push soft RMID counts To: Reinette Chatre Cc: Fenghua Yu , Babu Moger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Stephane Eranian , James Morse , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On Thu, May 11, 2023 at 11:40=E2=80=AFPM Reinette Chatre wrote: > On 4/21/2023 7:17 AM, Peter Newman wrote: > > list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) { > > - mbm_update(r, d, prgrp->mon.rmid); > > + /* > > + * mbm_update() on every RMID would result in excessive I= PIs > > + * when RMIDs are soft. > > + */ > > + if (!rdt_mon_soft_rmid) { > > + mbm_update(r, d, prgrp->mon.rmid); > > > > - head =3D &prgrp->mon.crdtgrp_list; > > - list_for_each_entry(crgrp, head, mon.crdtgrp_list) > > - mbm_update(r, d, crgrp->mon.rmid); > > + head =3D &prgrp->mon.crdtgrp_list; > > + list_for_each_entry(crgrp, head, mon.crdtgrp_list= ) > > + mbm_update(r, d, crgrp->mon.rmid); > > + } > > > > if (is_mba_sc(NULL)) > > update_mba_bw(prgrp, d); > > > hmmm ... I think that update_mba_bw() relies on mbm_update() to call > mbm_bw_count() to update the data it depends on. Keeping update_mba_bw() > while dropping mbm_update() thus seems problematic. AMD does not support = the > software controller though so it may make things simpler if support for > software RMIDs disables support for software controller (in a clear way). I looked over this again and realized that the rationale for skipping mbm_update() in this patch is incorrect. __mon_event_count_soft_rmid() does not send any IPIs, so it's perfectly fine to call mbm_update() and update_mba_bw() when using soft RMIDs. Even if we don't use the software controller on AMD, it seems conceptually cleaner to just allow soft and hard RMIDs to be used interchangeably wherever they work. -Peter