diff options
| author | Colin Cross <ccross@android.com> | 2011-07-12 20:10:37 -0700 | 
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2011-07-12 20:10:37 -0700 | 
| commit | 75c56a81116e51c5cf15c0641906d0745188cd16 (patch) | |
| tree | c1d8e7def5bbb099a39d5e9ccfb13508ea5ca46a /arch/x86/oprofile/nmi_int.c | |
| parent | b4294d618e8a19bb47826e51ae52b9fb2fe05f80 (diff) | |
| parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) | |
Merge commit 'v3.0-rc7' into android-3.0
Diffstat (limited to 'arch/x86/oprofile/nmi_int.c')
| -rw-r--r-- | arch/x86/oprofile/nmi_int.c | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index cf9750004a0..68894fdc034 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c @@ -112,8 +112,10 @@ static void nmi_cpu_start(void *dummy)  static int nmi_start(void)  {  	get_online_cpus(); -	on_each_cpu(nmi_cpu_start, NULL, 1);  	ctr_running = 1; +	/* make ctr_running visible to the nmi handler: */ +	smp_mb(); +	on_each_cpu(nmi_cpu_start, NULL, 1);  	put_online_cpus();  	return 0;  } @@ -504,15 +506,18 @@ static int nmi_setup(void)  	nmi_enabled = 0;  	ctr_running = 0; -	barrier(); +	/* make variables visible to the nmi handler: */ +	smp_mb();  	err = register_die_notifier(&profile_exceptions_nb);  	if (err)  		goto fail;  	get_online_cpus();  	register_cpu_notifier(&oprofile_cpu_nb); -	on_each_cpu(nmi_cpu_setup, NULL, 1);  	nmi_enabled = 1; +	/* make nmi_enabled visible to the nmi handler: */ +	smp_mb(); +	on_each_cpu(nmi_cpu_setup, NULL, 1);  	put_online_cpus();  	return 0; @@ -531,7 +536,8 @@ static void nmi_shutdown(void)  	nmi_enabled = 0;  	ctr_running = 0;  	put_online_cpus(); -	barrier(); +	/* make variables visible to the nmi handler: */ +	smp_mb();  	unregister_die_notifier(&profile_exceptions_nb);  	msrs = &get_cpu_var(cpu_msrs);  	model->shutdown(msrs); | 
