login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
16
Re: Possible bug with mutex adaptative spinning
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Benjamin Herrenschmidt
Subject:
Re: Possible bug with mutex adaptative spinning
Date: Friday, April 16, 2010 - 3:00 pm
>
quoted text
> I've queued the below patch
Thanks. Should it make -stable as well ? Cheers, Ben.
quoted text
> --- > Subject: mutex: Don't spin when the owner CPU is offline or other weird cases > From: Benjamin Herrenschmidt <benh@kernel.crashing.org> > Date: Fri Apr 16 23:20:00 CEST 2010 > > Due to recent load-balancer changes that delay the task migration to > the next wakeup, the adaptive mutex spinning ends up in a live lock > when the owner's CPU gets offlined because the cpu_online() check > lives before the owner running check. > > This patch changes mutex_spin_on_owner() to return 0 (don't spin) in > any case where we aren't sure about the owner struct validity or CPU > number, and if the said CPU is offline. There is no point going back & > re-evaluate spinning in corner cases like that, let's just go to > sleep. > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > LKML-Reference: <1271212509.13059.135.camel@pasglop> > --- > kernel/sched.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > Index: linux-2.6/kernel/sched.c > =================================================================== > --- linux-2.6.orig/kernel/sched.c > +++ linux-2.6/kernel/sched.c > @@ -3647,7 +3647,7 @@ int mutex_spin_on_owner(struct mutex *lo > * the mutex owner just released it and exited. > */ > if (probe_kernel_address(&owner->cpu, cpu)) > - goto out; > + return 0; > #else > cpu = owner->cpu; > #endif > @@ -3657,14 +3657,14 @@ int mutex_spin_on_owner(struct mutex *lo > * the cpu field may no longer be valid. > */ > if (cpu >= nr_cpumask_bits) > - goto out; > + return 0; > > /* > * We need to validate that we can do a > * get_cpu() and that we have the percpu area. > */ > if (!cpu_online(cpu)) > - goto out; > + return 0; > > rq = cpu_rq(cpu); > > @@ -3683,7 +3683,7 @@ int mutex_spin_on_owner(struct mutex *lo > > cpu_relax(); > } > -out: > + > return 1; > } > #endif >
--
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:
Possible bug with mutex adaptative spinning
, Benjamin Herrenschmidt
, (Tue Apr 13, 7:35 pm)
Re: Possible bug with mutex adaptative spinning
, Benjamin Herrenschmidt
, (Tue Apr 13, 7:56 pm)
Re: Possible bug with mutex adaptative spinning
, Peter Zijlstra
, (Fri Apr 16, 2:26 pm)
Re: Possible bug with mutex adaptative spinning
, Peter Zijlstra
, (Fri Apr 16, 2:27 pm)
Re: Possible bug with mutex adaptative spinning
, Benjamin Herrenschmidt
, (Fri Apr 16, 3:00 pm)
Re: Possible bug with mutex adaptative spinning
, Benjamin Herrenschmidt
, (Fri Apr 16, 3:01 pm)
[tip:core/urgent] mutex: Don't spin when the owner CPU is ...
, tip-bot for Benjamin ...
, (Fri Apr 23, 3:49 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Matthew Garrett
Re: [PATCH] Enable speedstep for sonoma processors.
Mauro Carvalho Chehab
Re: [PATCH 1/2] media: Add timberdale video-in driver
Peter Zijlstra
[PATCH 23/30] netvm: skb processing
Greg Kroah-Hartman
[PATCH 21/28] cgroupfs: create /sys/fs/cgroup to mount cgroupfs on
git
:
Jan Hudec
Re: GIT push to sftp (feature request)
Steffen Prohaska
[PATCH 0/4] core.ignorecase
Johannes Schindelin
Re: Git checkout preserve timestamp?
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Johan Herland
Re: What's cooking in git.git (Oct 2010, #01; Wed, 13)
linux-netdev
:
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Jan Engelhardt
Re: [PATCH] Fix netfilter xt_time's time_mt()'s use of do_div()
Herbert Xu
Re: [RFC PATCH 00/17] virtual-bus
Jeff Kirsher
Re: [net-next-2.6 PATCH] e1000e: don't inadvertently re-set INTX_DISABLE
git-commits-head
:
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
Linux Kernel Mailing List
Use path_put() in a few places instead of {mnt,d}put()
Linux Kernel Mailing List
mv643xx_eth: use sw csum for big packets
Linux Kernel Mailing List
arm: fix HAVE_CLK merge goof
Linux Kernel Mailing List
arm: convert pcm037 platform to use smsc911x
freebsd-current
:
David Wolfskill
"interrupt storm..."; seems associated with an0 NIC
Andriy Gapon
Re: letting glabel recognise a media change
Garrett Cooper
Re: Only display ACPI bootmenu key if ACPI is present
Pyun YongHyeon
CFT: msk(4) Rx checksum offloading support
FreeBSD Tinderbox
[head tinderbox] failure on sparc64/sparc64
Colocation donated by:
Syndicate