mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Shaopeng Tan <tan.shaopeng@fujitsu.com>,
	Jamie Iles <quic_jiles@quicinc.com>,
	James Morse <james.morse@arm.com>,
	"Babu Moger" <babu.moger@amd.com>
Cc: <x86@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 0/7] Add driver registration i/f to resctrl
Date: Fri, 5 May 2023 16:17:18 -0700	[thread overview]
Message-ID: <c0755752-ce84-b5f9-6ac6-97812e98b8c3@intel.com> (raw)
In-Reply-To: <20230420220636.53527-1-tony.luck@intel.com>

Hi Tony,

On 4/20/2023 3:06 PM, Tony Luck wrote:
> This is very much proof of concept code at this stage. I have a few
> quality of service features that are hard to intergrate into the core

(integrate?)

> resctrl code because they are model specific, or have input parameters
> that do not fit neatly into the existing schemata model.

I would like to understand these two motivations better.

Regarding "because they are model specific": the features would remain
model specific no matter from where they are supported so it sounds to
me that you would like to move/contain the model specific logic to
the drivers? Why would this be a motivation since it seems that this
would still make things model specific. I do not think resctrl is
averse to model specific code when I consider the code like
cache_alloc_hsw_probe() and __check_quirks_intel().

Regarding "do not fit neatly into the existing schemata model": could
you please elaborate? If I understand correctly a driver would like
to take ownership of a line in the schemata file, I then look at
a driver as providing support for a resource. It looks like 
these new resources may not be "domain aware" so would require unique
parsing, but that is something we can do in resctrl, no? Something
like a unique "parse_line()" associated with each resctrl resource?

Considering the above it is not clear to me at this point why this
driver interface is needed. Why could each new driver not instead be
a resctrl resource?

> Also, as AMD, ARM, and now RISC-V are looking to share the core resctrl
> code, it might be helpful to have "driver" as a software layer for
> per-CPU architectural code to avoid cluttering the core.
> 
> None of my drivers are ready to post, so this series has a simple example
> driver that would meet the same debug requirements of Babu Moger's
> patch to expose the CLOSID/RMID in files in each directory:
> 
>   https://lore.kernel.org/all/168177449635.1758847.13040588638888054027.stgit@bmoger-ubuntu/
> 
> Doing this debug with a driver that can be loaded unloaded without
> having to unmount and remount the resctrl file system appears slightly
> more convenient that a "-o debug" option. But this example driver is
> really intended just as a toy example of what can be done.

The driver seems simple but I think it already shows that this can get
complicated with many sharp corners. If I understand correctly this driver
will add the "closid" and "rmid" files in every control and monitor group. This
driver thus assumes a system that supports both control and monitoring, but
that is not guaranteed. For robustness the "rmid" file should not appear
in a control group that does not support monitoring.

> 
> The series is broken into steps that add callback functions into various
> different parts of the resctrl hierarchy. That list of parts has been
> driven by the needs of the drivers that I want to write. The
> registration interface could be extended if there are additional
> hooks need for other drivers.

The boundaries of the resctrl and driver interface are not clear to me.
Looking at where the new driver API is created and how it is used in the
example code I see that this occurs in include/linux/resctrl.h. This is
the API that an architecture using resctrl is intended to use and
thus provides much more to the drivers that I'd expect it to want to or
be able to use based on this description. 

> 
> I'm looking for high level comments on the desireability of this approach

(desirability?)

> at this time. I don't expect any of this to be merged until I have some
> real drivers that use this to offer to upstream.

Some hints about scenarios that require this driver interface would be
helpful.

Apart from the high level comments above I looked briefly at the patches
and responded there where I have some high level comments/questions.

Reinette


  parent reply	other threads:[~2023-05-05 23:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 22:06 Tony Luck
2023-04-20 22:06 ` [RFC PATCH 1/7] x86/resctrl: Add register/unregister functions for driver to hook into resctrl Tony Luck
2023-05-05 23:17   ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 2/7] x86/resctrl: Add an interface to add/remove a new info/directory Tony Luck
2023-04-20 22:06 ` [RFC PATCH 3/7] x86/resctrl: Add driver callback when directories are removed Tony Luck
2023-05-05 23:19   ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 4/7] x86/resctrl: Add capability to driver registration to create control files Tony Luck
2023-05-05 23:20   ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 5/7] x86/resctrl: Enhance driver registration to hook into schemata files Tony Luck
2023-05-05 23:20   ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 6/7] x86/resctrl: Allow a device to override an existing schemata entry Tony Luck
2023-05-05 23:20   ` Reinette Chatre
2023-04-20 22:06 ` [RFC PATCH 7/7] x86/resctrl: Example resctrl driver Tony Luck
2023-05-05 23:17 ` Reinette Chatre [this message]
2023-05-08 18:32   ` [RFC PATCH 0/7] Add driver registration i/f to resctrl Luck, Tony
2023-05-09 21:34     ` Reinette Chatre
2023-05-09 23:35       ` Luck, Tony
2023-05-10  0:07         ` Reinette Chatre
2023-05-10  0:52           ` Luck, Tony
2023-05-11 20:35         ` Luck, Tony
2023-05-12 16:57           ` Reinette Chatre
2023-05-12 20:35             ` Luck, Tony
2023-05-12 21:08               ` Reinette Chatre

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=c0755752-ce84-b5f9-6ac6-97812e98b8c3@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=quic_jiles@quicinc.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@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

all inboxes | Powered by JetHome®