login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
22
Re: [PATCH] x86/oprofile: disable preemption in nmi_shutdown
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Johannes Weiner <hannes@...>
To: Vegard Nossum <vegard.nossum@...>
Cc: Ingo Molnar <mingo@...>, Philippe Elie <phil.el@...>, <oprofile-list@...>, <linux-kernel@...>
Subject:
Re: [PATCH] x86/oprofile: disable preemption in nmi_shutdown
Date: Sunday, June 22, 2008 - 3:30 am
Hi Vegard, Vegard Nossum <vegard.nossum@gmail.com> writes:
quoted text
> Hi, > > Does this look correct? I didn't really play with preemption before, but > as far as I can tell, this is the right thing to do. > > I don't really get why model->shutdown(msrs) is done only for one of the > CPUs, but my patch assumes that this is correct. (If that had been done > from inside nmi_shutdown() for each CPU, we wouldn't have had to get the > cpu var, and not needed to disable preemption.) > > Please comment :-) > > > Vegard > > > From: Vegard Nossum <vegard.nossum@gmail.com> > Date: Sat, 21 Jun 2008 23:44:19 +0200 > Subject: [PATCH] x86/oprofile: disable preemption in nmi_shutdown > > BUG: using smp_processor_id() in preemptible [00000000] code: oprofiled/27301 > caller is nmi_shutdown+0x11/0x60 > Pid: 27301, comm: oprofiled Not tainted 2.6.26-rc7 #25 > [<c028a90d>] debug_smp_processor_id+0xbd/0xc0 > [<c045fba1>] nmi_shutdown+0x11/0x60 > [<c045dd4a>] oprofile_shutdown+0x2a/0x60 > > Note that we don't need this for the other functions, since they are all > called with on_each_cpu() (which disables preemption for us anyway). > > Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com> > --- > arch/x86/oprofile/nmi_int.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c > index cc48d3f..4a177b4 100644 > --- a/arch/x86/oprofile/nmi_int.c > +++ b/arch/x86/oprofile/nmi_int.c > @@ -269,12 +269,16 @@ static void nmi_cpu_shutdown(void *dummy) > > static void nmi_shutdown(void) > { > - struct op_msrs *msrs = &__get_cpu_var(cpu_msrs); > + struct op_msrs *msrs; > + > + preempt_disable(); > + msrs = &__get_cpu_var(cpu_msrs); > nmi_enabled = 0; > on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1); > unregister_die_notifier(&profile_exceptions_nb); > model->shutdown(msrs); > free_msrs(); > + preempt_enable();
Have a look at get_cpu_var() and put_cpu_var(), that is exactly the pattern. Hannes --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
v2.6.26-rc7/oprofile: BUG: using smp_processor_id() in preem...
, Vegard Nossum
, (Sat Jun 21, 2:28 pm)
[PATCH] x86/oprofile: disable preemption in nmi_shutdown
, Vegard Nossum
, (Sat Jun 21, 5:55 pm)
Re: [PATCH] x86/oprofile: disable preemption in nmi_shutdown
, Johannes Weiner
, (Sun Jun 22, 3:30 am)
Re: [PATCH] x86/oprofile: disable preemption in nmi_shutdown
, Vegard Nossum
, (Sun Jun 22, 3:40 am)
Re: [PATCH] x86/oprofile: disable preemption in nmi_shutdown
, Ingo Molnar
, (Tue Jun 24, 7:49 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 006/196] Chinese: add translation of oops-tracing.txt
Andrew Morton
Re: -mm merge plans for 2.6.23 -- sys_fallocate
Eric W. Biederman
[PATCH] nfs lockd reclaimer: Convert to kthread API
James Bottomley
Re: Integration of SCST in the mainstream Linux kernel
git
:
linux-netdev
:
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 03/37] dccp: List management for new feature negotiation
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
4 users
and
1137 guests
online.
Online users
zeekec
Jeremy
strcmp
edkitc30
Syndicate