Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp83818lqc; Thu, 7 Mar 2024 10:58:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXBS74Jw+HXQpZHnAul0jvKKdn/B3CePrDI564800xooHe+NuOqeNCgruivWSuPJpsSej2YYqRupUuytidH1jIEt1e/d5lCQ1rosNDYPg== X-Google-Smtp-Source: AGHT+IHsOa3i4y8toauBmGaekBalNdAX2I+JWHFB7Vc2F8PTA/q1f75lpMfdDhD6Zw4TS0VaCY5G X-Received: by 2002:a0c:f50c:0:b0:68f:2f35:4b3d with SMTP id j12-20020a0cf50c000000b0068f2f354b3dmr8501744qvm.35.1709837886714; Thu, 07 Mar 2024 10:58:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709837886; cv=pass; d=google.com; s=arc-20160816; b=NVWSYDzDUBz93kjNqbG3L0SJEIjjOX9cFeu8JZH4KCF0wC2VSZUsc5AvwVncTfawWJ cd+hh4MuJg7tnb1N2VcUelKzBHr/5t2/9vdKIP/o1iriEBfne/NDSIrg41P53eunWq0P uP8lfj5aLw1zwJwW9jZmnqu7EVmzu7eoQp44NZ7OW5mzXTvvcDvUMGJXrgxmT6Mq03FK PSTBrIxAFbOb0To2FwZR8EfX0JSSNXPl12uLfbUuGu2Zc5j0hwOJtdnCgIkvB5bnhvyu G1U7ibuhTvyLz1wB+UgckvMqsBslm7EcGkqlIakxAPdh+pmLMmUtkN9QlmTcK/Gg5DrO 5CLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=SZ7MjSCLcASwCBb5p6tcLsf8sPaCyROu84a0ZYjWmlU=; fh=7gF/TPthZAiQRIF8QipOmWJBcbeWqb82S8BiC1i7cl4=; b=L92BJftlxB6nsjK4YM5XVlmZCzhtOvOLAylD9yt5OPyNyLbzhKKDfXRVERCMM/SeS2 YUNW1YFTBqjIzFOjSlZfgY1gIzcqt9qfAtvk5taB02YOvqN5YP1SFnl7T/1AQ3znx0Iq Y1H9OMF4DeCEXWmFcNhvOMGDO/n6z0h5DZdondHqrvh4nhXpkvA9QxYYeUOiO81OKwyk ICFquuSYStCo3H9VRAncD9rb7x/nu0ZiMFDLkVm3XlbfqUWnvRHVc2+54PxMmDLpckdZ 2D/aaQWSEKOxQ52feYEFSBLH9Wsmaxms8sfNjwBZvRy5u32T3/Ndg+ZNISijLYD7umRI Lesg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tjuPC2XX; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-96044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s5-20020a0562140ca500b006902b00b301si17189294qvs.198.2024.03.07.10.58.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:58:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tjuPC2XX; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-96044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 62A591C21622 for ; Thu, 7 Mar 2024 18:58:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2470135A5A; Thu, 7 Mar 2024 18:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tjuPC2XX" Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A17553804 for ; Thu, 7 Mar 2024 18:57:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709837879; cv=none; b=NkbYGZ/84DNG4apfqi8szkWxQCzcSoocGUfMNi7Vv1N9D6HuTkiFoDlX9+Q8hze7L7wVp8fyD37dcfn/VbzB1dK0JE4jLNIgl7P4EGOTXbAC6EBgk4US6Xa+xKJuJgCAYpXVZbE9e/PiZEQFpuWDej48N8+LjjW8DfEmz0LcOmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709837879; c=relaxed/simple; bh=CzF6084T1W8QScTELrsPCEiFI9xcIZio9lEkN5NITI8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Zv9W3Wq0SK9FWmDZHH39mqlGyCT88iFNBKKmMrxrVhMh9DIj7XiyPk2QcGWXLMsK90RbWIaq+JRPeHicqbVKdfZBE2MzztiUcGleJKqx06dMVoSd2k2WSyp9GdTv4s36EaSqOMXMrpjH6PX9a+fJgugAYZ+hq6XfDHDNoHfrnZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tjuPC2XX; arc=none smtp.client-ip=209.85.160.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-428405a0205so33941cf.1 for ; Thu, 07 Mar 2024 10:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709837877; x=1710442677; 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=SZ7MjSCLcASwCBb5p6tcLsf8sPaCyROu84a0ZYjWmlU=; b=tjuPC2XX8/pBScH3jFj2KtCF66S5JUk/s/5RbUvW9M4lvmGhPZQHh1wrvszHT6xt7h RS3Bu/64Crz5v2VzbHyd9+Ovs2nGpGD8yh/e+iu+dCr4uN6gEi4JfUD9YCxwIbvvtZy+ H8pbzso2gi306neiQ5hmUIiUDKc7VrHFlCJ4f52U0WW4chnj7oNEDpGzn7Aq1dkFcovs rIu6RydrSESZS7krgHLzLtIPD+IoUBIm0zeEBrD6fCGmdgvItWLIHkjbfktkNjbagnsZ H+k8gab9Uiue4Mr+YKgAmW6+bCGTGOdChh+W4JZigsy5aKs7uaGZ117aVeiDnx41KzAB zoWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709837877; x=1710442677; 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=SZ7MjSCLcASwCBb5p6tcLsf8sPaCyROu84a0ZYjWmlU=; b=VIiRsMC1IUA0CHMQ152tTOmXs0X993mKVMBZ39tL04lytBiATmFlpxOHUFzvMX6VTq 9t6c789G8wlRGj3qo+wwoYdZDMltcrZjRPv5x7k9B8r9uojHP6Oo5HvcNF2O2CrlRTfv NCyPlLtlJh7bau/CiXT6jUmpAR2Ny4NaJ7WF3W5hmSCARCu5uO1qwO+X9kZK0zfmC8gh LyMOSCVI2i3L31/VBGozdTtkxnmu/0dYO/JJ9WHpsTu+Q2KeThnPgtKh0xaMwJzVnpW2 pj18jZvqmXmzX8GJ+mD5Lswrz1ngaTuReM+FMBTvby9y81rLIchZizzUDGKnOv/Xvn3s 0I3Q== X-Forwarded-Encrypted: i=1; AJvYcCU4AeUr2jizJ0ycWMkQhfv4woTRA9Oihr+l99OG6kA0ewDUoqrQQqY10LmufeSUAho8EKxrx7fNCCeYLgUT7u/Wb0FOF6+tUgAlS1uq X-Gm-Message-State: AOJu0YxSwA0/8cnFab0a0hSXPP6hECfwHR4kVeHspCMb2AIjZ0gck0AC +Ylmvi5nhQYOAuoPJGyqaROe+PTBITm4FrCtqXGuRiqDSSCB34VLAmQ8+MTR5SSFkpX3dXB1535 70hxo9rKpHh0zfTK4AXzYiyP9HFDz+ZPK8jx2 X-Received: by 2002:a05:622a:64c:b0:42f:a3c:2d47 with SMTP id a12-20020a05622a064c00b0042f0a3c2d47mr452569qtb.8.1709837876988; Thu, 07 Mar 2024 10:57:56 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231201005720.235639-1-babu.moger@amd.com> <2f373abf-f0c0-4f5d-9e22-1039a40a57f0@arm.com> <474ebe02-2d24-4ce3-b26a-46c520efd453@amd.com> <3fe3f235-d8a6-453b-b69d-6b7f81c07ae1@amd.com> <9b94b97e-4a8c-415e-af7a-d3f832592cf9@intel.com> <1ae73c9a-cec4-4496-86c6-3ffcef7940d6@amd.com> <32a588e2-7b09-4257-b838-4268583a724d@intel.com> <088878bd-7533-492d-838c-6b39a93aad4d@amd.com> <9b20589b-6220-4ae7-bfc4-4a826b7114b1@intel.com> <5ddb7031-a828-4001-bfdf-5477cb85e9ed@amd.com> <1738493b-3248-4c9e-82a8-1599a033440d@intel.com> <369ab28a-f3fa-4359-8e73-4dcf214c9b6e@amd.com> <54687d59-d0e4-4fe7-b25f-dc1fead01ea1@intel.com> <11487a31-908e-d474-50c6-65617d417deb@amd.com> <55b545fd-2851-0d0f-ac37-ec59838fb4b4@amd.com> <1f366890-d9ff-4ac4-9af9-1ea3128a87fc@intel.com> <41ca7504-c3fb-ddb6-e149-4ff82019d678@amd.com> In-Reply-To: <41ca7504-c3fb-ddb6-e149-4ff82019d678@amd.com> From: Peter Newman Date: Thu, 7 Mar 2024 10:57:45 -0800 Message-ID: Subject: Re: [PATCH v2 00/17] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC) To: babu.moger@amd.com Cc: Reinette Chatre , James Morse , corbet@lwn.net, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, paulmck@kernel.org, rdunlap@infradead.org, tj@kernel.org, peterz@infradead.org, yanjiewtw@gmail.com, kim.phillips@amd.com, lukas.bulwahn@gmail.com, seanjc@google.com, jmattson@google.com, leitao@debian.org, jpoimboe@kernel.org, rick.p.edgecombe@intel.com, kirill.shutemov@linux.intel.com, jithu.joseph@intel.com, kai.huang@intel.com, kan.liang@linux.intel.com, daniel.sneddon@linux.intel.com, pbonzini@redhat.com, sandipan.das@amd.com, ilpo.jarvinen@linux.intel.com, maciej.wieczor-retman@intel.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Babu, On Mon, Mar 4, 2024 at 2:24=E2=80=AFPM Moger, Babu wrote: > Based on our discussion, I am listing few examples here. Let me know if > I missed something. > > mount -t resctrl resctrl /sys/fs/resctrl/ > > 1. Assign both local and total counters to default group on domain 0 and = 1. > $echo "//00=3Dlt;01=3Dlt" > /sys/fs/resctrl/info/L3_MON/mbm_assign_co= ntrol > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > > 2. Assign a total event to mon group inside the default group for both > domain 0 and 1. > > $mkdir /sys/fs/resctrl/mon_groups/mon_a > $echo "/mon_a/00+t;01+t" > > /sys/fs/resctrl/info/L3_MON/mbm_assign_control > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > /mon_a/00=3Dt;01=3Dt > > 3. Assign a local event to non-default control mon group both domain 0 > and 1. > $mkdir /sys/fs/resctrl/ctrl_a > $echo "/ctrl_a/00=3Dl;01=3Dl" > > /sys/fs/resctrl/info/L3_MON/mbm_assign_control > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > /mon_a/00=3Dt;01=3Dt > /ctrl_a/00=3Dl;01=3Dl > > 4. Assign a both counters to mon group inside another control > group(non-default). > $mkdir /sys/fs/resctrl/ctrl_a/mon_ab/ > $echo "ctrl_a/mon_ab/00=3Dlt;01=3Dlt" > > /sys/fs/resctrl/nfo/L3_MON/mbm_assign_contro > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > /mon_a/00=3Dt;01=3Dt > /ctrl_a/00=3Dl;01=3Dl > ctrl_a/mon_ab/00=3Dlt;01=3Dlt > > 5. Unassign a counter to mon group inside another control > group(non-default). > $echo "ctrl_a/mon_ab/00-l;01-l" > > /sys/fs/resctrl/nfo/L3_MON/mbm_assign_control > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > /mon_a/00=3Dt;01=3Dt > /ctrl_a/00=3Dl;01=3Dl > ctrl_a/mon_ab/00=3Dt;01=3Dt > > 6. Unassign all the counters on a specific group. > $echo "ctrl_a/mon_ab/00=3D_" > > /sys/fs/resctrl/nfo/L3_MON/mbm_assign_control > > $cat /sys/fs/resctrl/info/L3_MON/mbm_assign_control > //00=3Dlt;01=3Dlt > /mon_a/00=3Dt;01=3Dt > /ctrl_a/00=3Dl;01=3Dl > ctrl_a/mon_ab/00=3D_;01=3D_ The use case I'm interested in is iterating 32 counters over 256 groups[1]. If it's not possible to reassign 32 counters in a single write system call, with just one IPI per domain per batch reassignment operation, then I don't see any advantage over the original proposal with the assignment control file in every group directory. We already had fine-grained control placing assign/unassign nodes throughout the directory hierarchy, with the scope implicit in the directory location. The interface I proposed in [1] aims to reduce the per-domain IPIs by a factor of the number of counters, rather than sending off 2 rounds of IPIs to each domain for each monitoring group. -Peter [1] https://lore.kernel.org/lkml/CALPaoChhKJiMAueFtgCTc7ffO++S5DJCySmxqf9ZD= mhR9RQapw@mail.gmail.com/