Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1609993
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions |
| Date | 2017-03-27 19:00 +0200 |
| Message-ID | <tpG9R-2Hb-41@gated-at.bofh.it> (permalink) |
| References | <tpFnr-2iK-17@gated-at.bofh.it> <tpFns-2iK-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 27, 2017 at 08:47:37AM -0700, kan.liang@intel.com wrote:
> From: Kan Liang <Kan.liang@intel.com>
>
> Having msr_set/clear_bit on many cpus or given CPU can avoid extra
> unnecessory IPIs
How does that happen?
You have smp_call_function_many() sending IPIs to each CPU in the mask.
Doesn't look like avoiding anything to me.
Now if you want to have interfaces set/clear_bit_on_cpu(s), that's a
different story.
And those actually double the amount of IPIs the moment you do a
read-modify-write operation on the MSR, i.e., you want to read *and*
write afterwards.
If you only want to do a single operation - set or clear - like you're
doing in your other patch, then I guess that's fine as it wraps the
smp_call_function* boilerplate code.
> and simplify MSR content manipulation, when it only
> needs to flip a bit.
> There is already msr_set/clear_bit, but missing the _on_cpu and _on_cpus
> version.
>
> Signed-off-by: Kan Liang <Kan.liang@intel.com>
> ---
> arch/x86/include/asm/msr.h | 29 ++++++++++++++++++
> arch/x86/lib/msr-smp.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 105 insertions(+)
>
> diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
> index 898dba2..9bc999b 100644
> --- a/arch/x86/include/asm/msr.h
> +++ b/arch/x86/include/asm/msr.h
> @@ -20,6 +20,11 @@ struct msr {
> };
> };
>
> +struct msr_bit_info {
> + u32 msr_no;
> + u8 bit;
> +};
No, not *another* struct msr*info. Please reuse msr_info.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 0/2] measure SMI cost (kernel) kan.liang@intel.com - 2017-03-27 18:10 +0200
[PATCH V2 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions kan.liang@intel.com - 2017-03-27 18:10 +0200
Re: [PATCH V2 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions Borislav Petkov <bp@alien8.de> - 2017-03-27 19:00 +0200
RE: [PATCH V2 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions "Liang, Kan" <kan.liang@intel.com> - 2017-03-27 19:20 +0200
csiph-web