Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread Chen, Gong
On Mon, Apr 14, 2014 at 09:23:08AM -0700, H. Peter Anvin wrote: > Please read Documentation/this_cpu_ops.txt for reference for how to use > these functions. However, you want to avoid forming a pointer if you > can; it is relatively expensive to do so. > :-). I just found your comment yesterday

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
Please read Documentation/this_cpu_ops.txt for reference for how to use these functions. However, you want to avoid forming a pointer if you can; it is relatively expensive to do so. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
On 04/14/2014 01:39 AM, Chen, Gong wrote: > @@ -619,7 +619,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t > *b) > continue; > > v = _cpu_var(mce_polled_error); > - set_bit(0, v); > + *v = 1; >

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
On 04/14/2014 01:39 AM, Chen, Gong wrote: > @@ -1287,14 +1287,14 @@ static unsigned long (*mce_adjust_timer)(unsigned > long interval) = > > static int cmc_error_seen(void) > { > - unsigned long *v = &__get_cpu_var(mce_polled_error); > + unsigned long *v = this_cpu_ptr(_polled_error);

[PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread Chen, Gong
According to Peter's suggestion, use this_cpu_* instead of __get_cpu_var. BTW, remove bitmask ops to avoid unnecessary overhead. Signed-off-by: Chen, Gong Suggested-by: H. Peter Anvin --- arch/x86/kernel/cpu/mcheck/mce.c | 36 ++-- 1 file changed, 18

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread Chen, Gong
On Mon, Apr 14, 2014 at 09:23:08AM -0700, H. Peter Anvin wrote: Please read Documentation/this_cpu_ops.txt for reference for how to use these functions. However, you want to avoid forming a pointer if you can; it is relatively expensive to do so. :-). I just found your comment yesterday so

[PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread Chen, Gong
According to Peter's suggestion, use this_cpu_* instead of __get_cpu_var. BTW, remove bitmask ops to avoid unnecessary overhead. Signed-off-by: Chen, Gong gong.c...@linux.intel.com Suggested-by: H. Peter Anvin h...@zytor.com --- arch/x86/kernel/cpu/mcheck/mce.c | 36

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
On 04/14/2014 01:39 AM, Chen, Gong wrote: @@ -1287,14 +1287,14 @@ static unsigned long (*mce_adjust_timer)(unsigned long interval) = static int cmc_error_seen(void) { - unsigned long *v = __get_cpu_var(mce_polled_error); + unsigned long *v = this_cpu_ptr(mce_polled_error);

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
On 04/14/2014 01:39 AM, Chen, Gong wrote: @@ -619,7 +619,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) continue; v = get_cpu_var(mce_polled_error); - set_bit(0, v); + *v = 1;

Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

2014-04-14 Thread H. Peter Anvin
Please read Documentation/this_cpu_ops.txt for reference for how to use these functions. However, you want to avoid forming a pointer if you can; it is relatively expensive to do so. -hpa -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message