Re: [PATCH 1/3] x86/resctrl: Get max rmid and occupancy scale directly from CPUID instead of cpuinfo_x86

From: Fenghua Yu
Date: Mon Jun 17 2019 - 04:49:26 EST


On Mon, Jun 17, 2019 at 10:30:48AM +0200, Borislav Petkov wrote:
> On Mon, Jun 17, 2019 at 01:09:09AM -0700, Fenghua Yu wrote:
> > I just keep the code a bit uniform around the calling area where
> > a few functions are called. So get_cqm_info() makes the code a bit more
> > readable.
> >
> > init_scattered_cpuid_features(c);
> > init_speculation_control(c);
> > + get_cqm_info(c);
> >
> > /*
> > * Clear/Set all flags overridden by options, after probe.
> > * This needs to happen each time we re-probe, which may happen
> > * several times during CPU initialization.
> > */
> > apply_forced_caps(c);
> > }
> >
> > Maybe not? If the function is not good, I can directly put the code here?
>
> If you want to have it cleaner, make that a separate patch and say so in
> the commit message. Patches should do one logical thing and not mix up
> different changes which makes review harder.

So in patch 0001, move the code of getting CQM info from before
calling init_scattered_cpuid_features(c) to after calling the function.

Then in patch 0002, carve out the code of getting CQM info into a
helper function get_cqm_info(c) for cleaner code.

Is this OK? Or the patch 0002 is unnecessary?

Thanks.

-Fenghua