[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1803301154580.1478@nanos.tec.linutronix.de>
Date: Tue, 3 Apr 2018 11:52:49 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
cc: vikas.shivappa@...el.com, tony.luck@...el.com,
ravi.v.shankar@...el.com, fenghua.yu@...el.com,
sai.praneeth.prakhya@...el.com, x86@...nel.org, hpa@...or.com,
linux-kernel@...r.kernel.org, ak@...ux.intel.com
Subject: Re: [PATCH 3/6] x86/intel_rdt/mba_sc: Add initialization support
On Thu, 29 Mar 2018, Vikas Shivappa wrote:
> +void setup_ctrlval(struct rdt_resource *r, u32 *dc, u32 *dm)
> +{
> + int i;
> +
> + /*
> + * Initialize the Control MSRs to having no control.
> + * For Cache Allocation: Set all bits in cbm
> + * For Memory Allocation: Set b/w requested to 100%
> + * and the b/w in MB to U32_MAX
> + */
> + for (i = 0; i < r->num_closid; i++, dc++, dm++) {
> + *dc = r->membw.bw_byte ? MBA_BW_MAX_MB : r->default_ctrl;
> + *dm = r->default_ctrl;
No! Please stop duct taping your stuff into the existing code. So far the
ctrl value was the same as the value which was actually written into the
MSR. With your new mode you have to split that up into the user supplied
value and the value which gets written into the MSR.
So the right thing to do is to separate the user value and the MSR value
first and independent of the mode. Then the new mode falls into place
naturally because r->default_ctrl and r->default_msrval are set up at mount
time with the values which correspond to the mount mode.
Thanks,
tglx
Powered by blists - more mailing lists