lkml.org 
[lkml]   [2022]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 5/5] x86/entry: Store CPU info on exception entry
From
On 8/5/22 10:30, ira.weiny@intel.com wrote:
> +static inline void arch_save_aux_pt_regs(struct pt_regs *regs)
> +{
> + struct pt_regs_auxiliary *aux_pt_regs = &to_extended_pt_regs(regs)->aux;
> +
> + aux_pt_regs->cpu = raw_smp_processor_id();
> +}

This is in a fast path that all interrupt and exception entry uses. So,
I was curious what the overhead is.

Code generation in irqentry_enter() gets a _bit_ more complicated
because arch_save_aux_pt_regs() has to be done on the way out of the
function and the compiler can't (for instance) do a

mov $0x1,%eax
ret

to return. But, the gist of the change is still only two instructions
that read a pretty hot, read-only per-cpu cacheline:

mov %gs:0x7e21fa4a(%rip),%eax # 15a38 <cpu_number>
mov %eax,-0x8(%rbx)

That doesn't seem too bad.

\
 
 \ /
  Last update: 2022-08-05 20:48    [W:0.236 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site