linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tony Luck <tony.luck@intel.com>
To: James Morse <james.morse@arm.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>,
	Babu Moger <babu.moger@amd.com>,
	Amit Singh Tomar <amitsinght@marvell.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	George Cherian <gcherian@marvell.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"peternewman@google.com" <peternewman@google.com>,
	Drew Fustini <dfustini@baylibre.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: resctrl2 - status
Date: Wed, 20 Sep 2023 17:21:12 -0700	[thread overview]
Message-ID: <ZQuMeCCUm2sHuX8p@agluck-desk3> (raw)
In-Reply-To: <ZQTAuChYjK9Y93y7@agluck-desk3>

On Fri, Sep 15, 2023 at 01:38:16PM -0700, Tony Luck wrote:
> My PoC code went full throttle on pushing all the schemata code to the
> driver. But you are right that this may be too drastic.  Drivers could
> just indicate that they need one of the basic types "bitmap, percentage,
> number, bandwidth" together with some parameters (number of bits for
> bitmap, granularity for percentage, high/low values for number, ditto
> for bandwidth) and have core code handle the inital parsing. Then give
> to the module for validation (e.g. for the Intel requirement that
> cache bit masks have contiguous "1" bits), and some CPU models require
> that a minimum of two bits are set). Also pass to the module to apply
> (wrmsr() on a CPU in the domain for x86, MMIO from anywhere for ARM).
> 
> For bitmasks - MPAM seems to allow very long masks. Perhaps the kernel
> can make use of the "%*pb" format to scanf/printk to cope with those?
> It would mean commas in the masks like 0000,00000fff,ffffff00,0000000f

James,

Your earlier e-mail came at a fortuitous moment. I am breaking my
giant patches into smaller pieces. I had just got to the "add the
schemata file" section of the series. I took your advice and put
the majority of the parsing code into the core, leaving the arch
specific modules just a hook to handle weird quirks.

Modules specify the "type" of their schemata entries, together with
a parameter that the core can use. I implemented two types so far.
But should be easy to add additional types like "bandwidth" as you
had suggested.

1) Bitmask. Parameter is the number of bits.
2) Unsigned long. Parameter is the max value.

Examples of quirks:
1) Intel L3 CAT requires all "1" bits to be in a consecutive block.
   In this case core code will accept any bitmask that doesn't exceed
   the number of bits. The module can reject if the user doesn't
   follow the consecutive bits rule.
2) Intel L3 MBA requires that throttle percentage values be a multiple of the
   h/w enumerated granularity (e.g. 10%). Here the module does a
   roundup() to quietly fix invalid input (same as legacy resctrl).

I've only got through the "control" section of converting to patches.
But I think this is well past the halfway point.

Current snapshot of code is here:


git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git resctrl2_patches


* Comes with just the rdt_l3_cat and rdt_l3_mba modules.
  Without the AMD support bits at this point.
* No "cpus", "mode", "size" files yet.
* Just CTRL_MON directories.
* No monitoring support yet.

-Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-09-21  0:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 18:10 resctrl2 - status Luck, Tony
2023-08-25 17:47 ` Reinette Chatre
2023-08-25 18:09   ` Luck, Tony
2023-08-25 18:58     ` Reinette Chatre
2023-08-25 19:44       ` Luck, Tony
2023-08-25 20:20         ` Reinette Chatre
2023-08-25 20:54           ` Tony Luck
2023-08-25 23:08             ` Reinette Chatre
2023-08-26  1:11               ` Tony Luck
2023-08-28 14:50                 ` Reinette Chatre
2023-09-06 18:21                   ` Tony Luck
2023-09-08 18:08                     ` Moger, Babu
2023-09-08 18:51                       ` Luck, Tony
2023-09-08 21:35                         ` Moger, Babu
2023-09-08 23:13                           ` Tony Luck
2023-09-15 17:55                             ` Drew Fustini
2023-09-18 10:44                               ` Jonathan Cameron
2023-09-28  8:47                                 ` Peter Newman
2023-09-28 14:47                                   ` Luck, Tony
2023-09-29  9:38                                     ` Jonathan Cameron
2023-09-29 14:49                                   ` Drew Fustini
2023-09-15 17:16                     ` James Morse
2023-09-15 20:38                       ` Tony Luck
2023-09-21  0:21                         ` Tony Luck [this message]
2023-09-19 12:53                     ` Peter Newman
2023-09-19 16:40                       ` Tony Luck
2023-08-29 10:23           ` Jonathan Cameron
2023-08-29 17:18             ` [EXT] " Amit Singh Tomar
2023-08-30 10:47               ` Jonathan Cameron
2023-09-15 17:16                 ` James Morse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZQuMeCCUm2sHuX8p@agluck-desk3 \
    --to=tony.luck@intel.com \
    --cc=amitsinght@marvell.com \
    --cc=babu.moger@amd.com \
    --cc=dfustini@baylibre.com \
    --cc=fenghua.yu@intel.com \
    --cc=gcherian@marvell.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).