[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7dCzCbM5puaoFzG@e133380.arm.com>
Date: Thu, 20 Feb 2025 14:57:16 +0000
From: Dave Martin <Dave.Martin@....com>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: Babu Moger <babu.moger@....com>, "corbet@....net" <corbet@....net>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"peternewman@...gle.com" <peternewman@...gle.com>,
"x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
"paulmck@...nel.org" <paulmck@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"thuth@...hat.com" <thuth@...hat.com>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"xiongwei.song@...driver.com" <xiongwei.song@...driver.com>,
"pawan.kumar.gupta@...ux.intel.com" <pawan.kumar.gupta@...ux.intel.com>,
"daniel.sneddon@...ux.intel.com" <daniel.sneddon@...ux.intel.com>,
"jpoimboe@...nel.org" <jpoimboe@...nel.org>,
"perry.yuan@....com" <perry.yuan@....com>,
"sandipan.das@....com" <sandipan.das@....com>,
"Huang, Kai" <kai.huang@...el.com>,
"Li, Xiaoyao" <xiaoyao.li@...el.com>,
"seanjc@...gle.com" <seanjc@...gle.com>,
"Li, Xin3" <xin3.li@...el.com>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"ebiggers@...gle.com" <ebiggers@...gle.com>,
"mario.limonciello@....com" <mario.limonciello@....com>,
"james.morse@....com" <james.morse@....com>,
"tan.shaopeng@...itsu.com" <tan.shaopeng@...itsu.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Wieczor-Retman, Maciej" <maciej.wieczor-retman@...el.com>,
"Eranian, Stephane" <eranian@...gle.com>
Subject: Re: [PATCH v11 23/23] x86/resctrl: Introduce interface to modify
assignment states of the groups
[Dropped Cc: fenghua.yu@...el.com <fenghua.yu@...el.com> (bounces)]
On Wed, Feb 19, 2025 at 05:43:43PM +0000, Luck, Tony wrote:
> > I hacked up something a bit like this so that schemata could be written
> > interactively from the shell, so I can try to port that onto this series
> > as an illustration, if it helps.
>
> Note that schemata will accept writes that just change the bits you want to change.
>
> So from the shell:
>
> # cat schemata
> MB:0=100;1=100
> L3:0=fff;1=fff
>
> # echo "MB:1=90" > schemata
>
> # cat schemata
> MB:0=100;1= 90
> L3:0=fff;1=fff
>
> -Tony
>
Yes, but not:
# {
p=:
echo -n MB
for ((d = 0; d < 2; d++)); do
echo -n "$p$d=100"
p=';'
done
echo
} >schemata
(Or at least, it depends on the shell. Each simple command that
generates output can result in a separate write() call -- certainly
there is no guarantee that it won't.)
Doing the same thing from C will "work", because by default I/O on the
schemata file will be fully buffered in userspace... unless the whole
output exceeds the default buffer size.
The difference from sysfs here is that it would be insane to write a
small, single formatted value in pieces when it is natural to generate
it from a single format specifier -- whereas the syntax of some of
resctrl's files has a multilevel internal structure that has to be
built up in a piecemeal fashion (whether or not it is written to the
file in one go).
I'm not saying that this is an issue for realistic uses though, and
anyway, the schemata file is nothing to do with this series.
Cheers
---Dave
Powered by blists - more mailing lists