From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [GIT PULL] core fixes
Date: Tue, 24 Aug 2010 21:01:21 +0200 [thread overview]
Message-ID: <20100824190121.GA745@elte.hu> (raw)
Linus,
Please pull the latest core-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-fixes-for-linus
This contains the mutex optimistic spinning fix from Tim Chen. It is not
a regression fix per se - but the improvement is significant enough (and
the patch is simple enough as well) to not let this sit for yet another
cycle.
Thanks,
Ingo
------------------>
Tim Chen (1):
mutex: Improve the scalability of optimistic spinning
kernel/sched.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 41541d7..09b574e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3865,8 +3865,16 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner)
/*
* Owner changed, break to re-assess state.
*/
- if (lock->owner != owner)
+ if (lock->owner != owner) {
+ /*
+ * If the lock has switched to a different owner,
+ * we likely have heavy contention. Return 0 to quit
+ * optimistic spinning and not contend further:
+ */
+ if (lock->owner)
+ return 0;
break;
+ }
/*
* Is that owner really running on that cpu?
next reply other threads:[~2010-08-24 19:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-24 19:01 Ingo Molnar [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-05-04 17:49 [GIT PULL] core fixes Ingo Molnar
2009-04-26 17:10 Ingo Molnar
2009-04-17 0:50 Ingo Molnar
2009-04-13 17:28 Ingo Molnar
2009-04-09 15:36 Ingo Molnar
2009-02-17 16:34 [git pull] " Ingo Molnar
2009-01-13 1:16 Ingo Molnar
2008-10-21 14:47 Ingo Molnar
2008-10-23 16:43 ` Linus Torvalds
2008-08-22 12:26 Ingo Molnar
2008-08-11 22:20 Ingo Molnar
2008-08-12 6:13 ` Nick Piggin
2008-08-12 7:17 ` Peter Zijlstra
2008-08-12 7:31 ` Nick Piggin
2008-08-12 8:05 ` Nick Piggin
2008-08-12 9:25 ` Ingo Molnar
2008-08-12 10:42 ` Nick Piggin
2008-08-14 4:45 ` Nick Piggin
2008-08-15 12:58 ` Ingo Molnar
2008-08-18 5:22 ` Nick Piggin
2008-08-18 6:17 ` Nick Piggin
2008-08-18 6:22 ` Ingo Molnar
2008-08-12 15:20 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100824190121.GA745@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox