All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Amit Singh Tomar <amitsinght@marvell.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	"james.morse@arm.com" <james.morse@arm.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: [EXT] Re: resctrl2 - status
Date: Wed, 30 Aug 2023 11:47:31 +0100	[thread overview]
Message-ID: <20230830114731.00003590@Huawei.com> (raw)
In-Reply-To: <MW4PR18MB50847485155B226B07DABEAAC6E7A@MW4PR18MB5084.namprd18.prod.outlook.com>

On Tue, 29 Aug 2023 17:18:53 +0000
Amit Singh Tomar <amitsinght@marvell.com> wrote:

> -----Original Message-----
> From: Jonathan Cameron <Jonathan.Cameron@Huawei.com> 
> Sent: Tuesday, August 29, 2023 3:53 PM
> To: Reinette Chatre <reinette.chatre@intel.com>
> Cc: Luck, Tony <tony.luck@intel.com>; Amit Singh Tomar <amitsinght@marvell.com>; Yu, Fenghua <fenghua.yu@intel.com>; james.morse@arm.com; George Cherian <gcherian@marvell.com>; robh@kernel.org; peternewman@google.com; Drew Fustini <dfustini@baylibre.com>; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: resctrl2 - status
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Fri, 25 Aug 2023 13:20:22 -0700
> Reinette Chatre <reinette.chatre@intel.com> wrote:
> 
> > Hi Tony,
> > 
> > On 8/25/2023 12:44 PM, Luck, Tony wrote:  
> > >>>> Alternatively, can user space just take a "load all resctrl 
> > >>>> modules and see what sticks" (even modules of different 
> > >>>> architectures since a user space may want to be generic) approach?  
> > >>>
> > >>> This mostly works. Except for the cases where different modules 
> > >>> access the same underlying hardware, so can't be loaded together.
> > >>>
> > >>> Examples:
> > >>>
> > >>> rdt_l3_cat vs. rdt_l3_cdp - user needs to decide whether they want CDP or not.
> > >>> But this is already true ... they have to decide whether to pass 
> > >>> the "-o cdp" option to mount.
> > >>>
> > >>> rdt_l3_mba vs. rdt_l3_mba_MBps - does the user want to control 
> > >>> memory bandwidth with percentages, or with MB/sec values. Again 
> > >>> the user already has to make this decision when choosing mount options.
> > >>>
> > >>>
> > >>> Maybe the "What resctrl options does this machine support?" 
> > >>> question would be best answered with a small utility?  
> > >>
> > >> A user space utility or a kernel provided utility? If it is a user 
> > >> space utility I think it would end up needing to duplicate what the 
> > >> kernel is required to do to know if a particular feature is 
> > >> supported. It seems appropriate that this could be a kernel utility 
> > >> that can share this existing information with user space. resctrl already supports the interface for this via /sys/fs/resctrl/info.  
> > > 
> > > I was imagining a user space utility. Even though /proc/cpuinfo 
> > > doesn't show all features, a utility has access to all the CPUID 
> > > leaves that contain the details of each feature enumeration.  
> > 
> > For x86 that may work (in some scenarios, see later) for now but as I 
> > understand Arm would need a different solution where I believe the 
> > information is obtained via ACPI. I think it is unnecessary to require 
> > user space to have parsers for CPUID and ACPI if that same information 
> > needs to be parsed by the kernel and there already exists an interface 
> > with which the information is communicated from kernel to user space. 
> > Also, just because information CPUID shows a feature is supported by 
> > the hardware does not mean that the kernel has support for that 
> > feature. This could be because of a feature mismatch between user 
> > space and kernel, or even some features disabled for use via the, for example "rdt=!l3cat", kernel parameter.  
> 
> James probably also has views on this, but I wouldn't expect userspace to go anywhere near ACPI parsing. If the description of what MPAM features are supported (before resctrl is running) is necessary, then we should add it to the existing description of the various caches etc.  Maybe somewhere in /sys/bus/node/devices/nodeX/cpuY/cache/indexZ/
> for the caches
> and
> /sys/bus/node/devices/nodeX for the DRAM controllers.
> [>>] Or may be all the MPAM features list is unified at one place, something like this ?  
> https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot/v6.5-rc1&id=c32874cd1d68241c481a9d0c32c8c65d019c247e

Fine for debug, not for generic tooling.

Might be possible to do something separate but I would expect to see this
info associated with the entities being controlled, not off on it's own
somewhere else in sysfs or similar.

Jonathan


> 
> I'm sure we can find somewhere sensible for other things covered by MPAM.
> The MPAM table parsers and some early code to query features from the hardware should be able to figure out what is needed.
> 
> Perhaps x86 systems could provide similar descriptions but originating from CPUID etc.
> 
> Jonathan
> 
> >   
> > >> fyi ... as with previous attempts to discuss this work I find it 
> > >> difficult to discuss this work when you are selective about what 
> > >> you want to discuss/answer and just wipe the rest. Through this I 
> > >> understand that I am not your target audience.  
> > > 
> > > Not my intent. I value your input highly. I'm maybe too avid a 
> > > follower of the "trim your replies" school of e-mail etiquette. I 
> > > thought I'd covered the gist of your message.
> > > 
> > > I'll try to be more thorough in responding in the future.    
> > 
> > Two items from my previous email remain open:
> > 
> > First, why does making the code modular require everything to be 
> > loadable modules?
> > I think that it is great that the code is modular. Ideally it will 
> > help to support the other architectures. As you explain this modular 
> > design also has the benefit that "modules" can be loaded and unloaded after resctrl mount.
> > Considering your example of MBA and MBA_MBps support ... if I 
> > understand correctly with code being modular it enables changes from 
> > one to the other after resctrl mount. User can start with MBA and then 
> > switch to MBA_MBps without needing to unmount resctrl. What I do not 
> > understand is why does the code being modular require everything to be 
> > modules? Why, for example, could a user not interact with a resctrl 
> > file that enables the user to make this switch from, for example, MBA 
> > to MBA_MBps? With this the existing interfaces can remain to be 
> > respected, the existing mount parameters need to remain anyway, while enabling future "more modular" usages.
> > 
> > Second, copied from my previous email, what is the plan to deal with 
> > current users that just mount resctrl and expect to learn from it what 
> > features are supported?
> > 
> > Reinette
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.or
> > g_mailman_listinfo_linux-2Darm-2Dkernel&d=DwICAg&c=nKjWec2b6R0mOyPaz7x
> > tfQ&r=V_GK7jRuCHDErm6txmgDK1-MbUihtnSQ3gPgB-A-JKU&m=ri5Ay9ia3NmwAS6P94yjZ7rPIR1dIqrIAIjpslfwcd5ulIIs5BNEG9jmTlq6H6o8&s=KZMxmC8InOxAyxgrDig96R2aKf2hc1C_hk_1413pjCI&e=
> >   
> 


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

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Amit Singh Tomar <amitsinght@marvell.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	"james.morse@arm.com" <james.morse@arm.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: [EXT] Re: resctrl2 - status
Date: Wed, 30 Aug 2023 11:47:31 +0100	[thread overview]
Message-ID: <20230830114731.00003590@Huawei.com> (raw)
In-Reply-To: <MW4PR18MB50847485155B226B07DABEAAC6E7A@MW4PR18MB5084.namprd18.prod.outlook.com>

On Tue, 29 Aug 2023 17:18:53 +0000
Amit Singh Tomar <amitsinght@marvell.com> wrote:

> -----Original Message-----
> From: Jonathan Cameron <Jonathan.Cameron@Huawei.com> 
> Sent: Tuesday, August 29, 2023 3:53 PM
> To: Reinette Chatre <reinette.chatre@intel.com>
> Cc: Luck, Tony <tony.luck@intel.com>; Amit Singh Tomar <amitsinght@marvell.com>; Yu, Fenghua <fenghua.yu@intel.com>; james.morse@arm.com; George Cherian <gcherian@marvell.com>; robh@kernel.org; peternewman@google.com; Drew Fustini <dfustini@baylibre.com>; linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: resctrl2 - status
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Fri, 25 Aug 2023 13:20:22 -0700
> Reinette Chatre <reinette.chatre@intel.com> wrote:
> 
> > Hi Tony,
> > 
> > On 8/25/2023 12:44 PM, Luck, Tony wrote:  
> > >>>> Alternatively, can user space just take a "load all resctrl 
> > >>>> modules and see what sticks" (even modules of different 
> > >>>> architectures since a user space may want to be generic) approach?  
> > >>>
> > >>> This mostly works. Except for the cases where different modules 
> > >>> access the same underlying hardware, so can't be loaded together.
> > >>>
> > >>> Examples:
> > >>>
> > >>> rdt_l3_cat vs. rdt_l3_cdp - user needs to decide whether they want CDP or not.
> > >>> But this is already true ... they have to decide whether to pass 
> > >>> the "-o cdp" option to mount.
> > >>>
> > >>> rdt_l3_mba vs. rdt_l3_mba_MBps - does the user want to control 
> > >>> memory bandwidth with percentages, or with MB/sec values. Again 
> > >>> the user already has to make this decision when choosing mount options.
> > >>>
> > >>>
> > >>> Maybe the "What resctrl options does this machine support?" 
> > >>> question would be best answered with a small utility?  
> > >>
> > >> A user space utility or a kernel provided utility? If it is a user 
> > >> space utility I think it would end up needing to duplicate what the 
> > >> kernel is required to do to know if a particular feature is 
> > >> supported. It seems appropriate that this could be a kernel utility 
> > >> that can share this existing information with user space. resctrl already supports the interface for this via /sys/fs/resctrl/info.  
> > > 
> > > I was imagining a user space utility. Even though /proc/cpuinfo 
> > > doesn't show all features, a utility has access to all the CPUID 
> > > leaves that contain the details of each feature enumeration.  
> > 
> > For x86 that may work (in some scenarios, see later) for now but as I 
> > understand Arm would need a different solution where I believe the 
> > information is obtained via ACPI. I think it is unnecessary to require 
> > user space to have parsers for CPUID and ACPI if that same information 
> > needs to be parsed by the kernel and there already exists an interface 
> > with which the information is communicated from kernel to user space. 
> > Also, just because information CPUID shows a feature is supported by 
> > the hardware does not mean that the kernel has support for that 
> > feature. This could be because of a feature mismatch between user 
> > space and kernel, or even some features disabled for use via the, for example "rdt=!l3cat", kernel parameter.  
> 
> James probably also has views on this, but I wouldn't expect userspace to go anywhere near ACPI parsing. If the description of what MPAM features are supported (before resctrl is running) is necessary, then we should add it to the existing description of the various caches etc.  Maybe somewhere in /sys/bus/node/devices/nodeX/cpuY/cache/indexZ/
> for the caches
> and
> /sys/bus/node/devices/nodeX for the DRAM controllers.
> [>>] Or may be all the MPAM features list is unified at one place, something like this ?  
> https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot/v6.5-rc1&id=c32874cd1d68241c481a9d0c32c8c65d019c247e

Fine for debug, not for generic tooling.

Might be possible to do something separate but I would expect to see this
info associated with the entities being controlled, not off on it's own
somewhere else in sysfs or similar.

Jonathan


> 
> I'm sure we can find somewhere sensible for other things covered by MPAM.
> The MPAM table parsers and some early code to query features from the hardware should be able to figure out what is needed.
> 
> Perhaps x86 systems could provide similar descriptions but originating from CPUID etc.
> 
> Jonathan
> 
> >   
> > >> fyi ... as with previous attempts to discuss this work I find it 
> > >> difficult to discuss this work when you are selective about what 
> > >> you want to discuss/answer and just wipe the rest. Through this I 
> > >> understand that I am not your target audience.  
> > > 
> > > Not my intent. I value your input highly. I'm maybe too avid a 
> > > follower of the "trim your replies" school of e-mail etiquette. I 
> > > thought I'd covered the gist of your message.
> > > 
> > > I'll try to be more thorough in responding in the future.    
> > 
> > Two items from my previous email remain open:
> > 
> > First, why does making the code modular require everything to be 
> > loadable modules?
> > I think that it is great that the code is modular. Ideally it will 
> > help to support the other architectures. As you explain this modular 
> > design also has the benefit that "modules" can be loaded and unloaded after resctrl mount.
> > Considering your example of MBA and MBA_MBps support ... if I 
> > understand correctly with code being modular it enables changes from 
> > one to the other after resctrl mount. User can start with MBA and then 
> > switch to MBA_MBps without needing to unmount resctrl. What I do not 
> > understand is why does the code being modular require everything to be 
> > modules? Why, for example, could a user not interact with a resctrl 
> > file that enables the user to make this switch from, for example, MBA 
> > to MBA_MBps? With this the existing interfaces can remain to be 
> > respected, the existing mount parameters need to remain anyway, while enabling future "more modular" usages.
> > 
> > Second, copied from my previous email, what is the plan to deal with 
> > current users that just mount resctrl and expect to learn from it what 
> > features are supported?
> > 
> > Reinette
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.infradead.or
> > g_mailman_listinfo_linux-2Darm-2Dkernel&d=DwICAg&c=nKjWec2b6R0mOyPaz7x
> > tfQ&r=V_GK7jRuCHDErm6txmgDK1-MbUihtnSQ3gPgB-A-JKU&m=ri5Ay9ia3NmwAS6P94yjZ7rPIR1dIqrIAIjpslfwcd5ulIIs5BNEG9jmTlq6H6o8&s=KZMxmC8InOxAyxgrDig96R2aKf2hc1C_hk_1413pjCI&e=
> >   
> 


  reply	other threads:[~2023-08-30 10:48 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 18:10 resctrl2 - status Luck, Tony
2023-08-24 18:10 ` Luck, Tony
2023-08-25 17:47 ` Reinette Chatre
2023-08-25 17:47   ` Reinette Chatre
2023-08-25 18:09   ` Luck, Tony
2023-08-25 18:09     ` Luck, Tony
2023-08-25 18:58     ` Reinette Chatre
2023-08-25 18:58       ` Reinette Chatre
2023-08-25 19:44       ` Luck, Tony
2023-08-25 19:44         ` Luck, Tony
2023-08-25 20:20         ` Reinette Chatre
2023-08-25 20:20           ` Reinette Chatre
2023-08-25 20:54           ` Tony Luck
2023-08-25 20:54             ` Tony Luck
2023-08-25 23:08             ` Reinette Chatre
2023-08-25 23:08               ` Reinette Chatre
2023-08-26  1:11               ` Tony Luck
2023-08-26  1:11                 ` Tony Luck
2023-08-28 14:50                 ` Reinette Chatre
2023-08-28 14:50                   ` Reinette Chatre
2023-09-06 18:21                   ` Tony Luck
2023-09-06 18:21                     ` Tony Luck
2023-09-08 18:08                     ` Moger, Babu
2023-09-08 18:08                       ` Moger, Babu
2023-09-08 18:51                       ` Luck, Tony
2023-09-08 18:51                         ` Luck, Tony
2023-09-08 21:35                         ` Moger, Babu
2023-09-08 21:35                           ` Moger, Babu
2023-09-08 23:13                           ` Tony Luck
2023-09-08 23:13                             ` Tony Luck
2023-09-15 17:55                             ` Drew Fustini
2023-09-15 17:55                               ` Drew Fustini
2023-09-18 10:44                               ` Jonathan Cameron
2023-09-18 10:44                                 ` Jonathan Cameron
2023-09-28  8:47                                 ` Peter Newman
2023-09-28  8:47                                   ` Peter Newman
2023-09-28 14:47                                   ` Luck, Tony
2023-09-28 14:47                                     ` Luck, Tony
2023-09-29  9:38                                     ` Jonathan Cameron
2023-09-29  9:38                                       ` Jonathan Cameron
2023-09-29 14:49                                   ` Drew Fustini
2023-09-29 14:49                                     ` Drew Fustini
2023-09-15 17:16                     ` James Morse
2023-09-15 17:16                       ` James Morse
2023-09-15 20:38                       ` Tony Luck
2023-09-15 20:38                         ` Tony Luck
2023-09-21  0:21                         ` Tony Luck
2023-09-21  0:21                           ` Tony Luck
2023-09-19 12:53                     ` Peter Newman
2023-09-19 12:53                       ` Peter Newman
2023-09-19 16:40                       ` Tony Luck
2023-09-19 16:40                         ` Tony Luck
2023-08-29 10:23           ` Jonathan Cameron
2023-08-29 10:23             ` Jonathan Cameron
2023-08-29 17:18             ` [EXT] " Amit Singh Tomar
2023-08-29 17:18               ` Amit Singh Tomar
2023-08-30 10:47               ` Jonathan Cameron [this message]
2023-08-30 10:47                 ` Jonathan Cameron
2023-09-15 17:16                 ` James Morse
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=20230830114731.00003590@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=amitsinght@marvell.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 \
    --cc=tony.luck@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.