lkml.org 
[lkml]   [2008]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] perf_counter: more barrier in blank weak function
Date
> 
> Impact: fix panic possible panic etc
>
> some compiler seems to inline the weak global function if no line in it
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
> index d7a79f3..37f7716 100644
> --- a/kernel/perf_counter.c
> +++ b/kernel/perf_counter.c
> @@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter)
> }
>
> u64 __weak hw_perf_save_disable(void) { return 0; }
> -void __weak hw_perf_restore(u64 ctrl) { }
> -void __weak hw_perf_counter_setup(void) { }
> +void __weak hw_perf_restore(u64 ctrl) { barrier(); }
> +void __weak hw_perf_counter_setup(void) { barrier(); }

We need comment into the function.
I expect anyone think "hm, this barrier() is meaningless. let's cleanup." in the future.
we should avoid it.





\
 
 \ /
  Last update: 2008-12-27 07:09    [W:1.416 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site