[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1375815765.25420.45.camel@gandalf.local.home>
Date: Tue, 06 Aug 2013 15:02:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Christoph Lameter <cl@...two.org>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...ux.intel.com>
Subject: Re: x86: use this_cpu for debug_stack_usage
On Tue, 2013-08-06 at 18:56 +0000, Christoph Lameter wrote:
> > Might as well change is_debug_stack() to use __this_cpu_read() instead
> > of __get_cpu_var().
I just noticed that you didn't include the x86 maintainers.
Reviewed-by: Steven Rostedt <rostedt@...dmis.org>
-- Steve
>
>
>
>
>
> Subject: x86: use this_cpu for debug_stack_usage
>
> Reduces overhead a bit and frees up a couple of registers.
>
> Signed-off-by: Christoph Lameter <cl@...ux.com>
>
> Index: linux/arch/x86/include/asm/debugreg.h
> ===================================================================
> --- linux.orig/arch/x86/include/asm/debugreg.h 2013-08-06 13:52:23.740092873 -0500
> +++ linux/arch/x86/include/asm/debugreg.h 2013-08-06 13:52:23.740092873 -0500
> @@ -97,11 +97,11 @@ extern void hw_breakpoint_restore(void);
> DECLARE_PER_CPU(int, debug_stack_usage);
> static inline void debug_stack_usage_inc(void)
> {
> - __get_cpu_var(debug_stack_usage)++;
> + __this_cpu_inc(debug_stack_usage);
> }
> static inline void debug_stack_usage_dec(void)
> {
> - __get_cpu_var(debug_stack_usage)--;
> + __this_cpu_dec(debug_stack_usage);
> }
> int is_debug_stack(unsigned long addr);
> void debug_stack_set_zero(void);
> Index: linux/arch/x86/kernel/cpu/common.c
> ===================================================================
> --- linux.orig/arch/x86/kernel/cpu/common.c 2013-07-19 09:06:36.850047837 -0500
> +++ linux/arch/x86/kernel/cpu/common.c 2013-08-06 13:54:36.426384889 -0500
> @@ -1144,9 +1144,9 @@ DEFINE_PER_CPU(int, debug_stack_usage);
>
> int is_debug_stack(unsigned long addr)
> {
> - return __get_cpu_var(debug_stack_usage) ||
> - (addr <= __get_cpu_var(debug_stack_addr) &&
> - addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ));
> + return __this_cpu_read(debug_stack_usage) ||
> + (addr <= __this_cpu_read(debug_stack_addr) &&
> + addr > (__this_cpu_read(debug_stack_addr) - DEBUG_STKSZ));
> }
>
> DEFINE_PER_CPU(u32, debug_idt_ctr);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists