[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080508092547.GA32574@elte.hu>
Date: Thu, 8 May 2008 11:25:47 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Mike Galbraith <efault@....de>
Cc: "Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: sysbench+mysql(oltp, readonly) 30% regression with 2.6.26-rc1
* Ingo Molnar <mingo@...e.hu> wrote:
> - down(&kernel_sem);
> + if (panic_timeout) {
> + while (down_trylock(&kernel_sem))
> + cpu_relax();
updated one below - this will work fine in the !panic_timeout case too
;-)
Ingo
Index: linux/lib/kernel_lock.c
===================================================================
--- linux.orig/lib/kernel_lock.c
+++ linux/lib/kernel_lock.c
@@ -46,7 +46,12 @@ int __lockfunc __reacquire_kernel_lock(v
task->lock_depth = -1;
preempt_enable_no_resched();
- down(&kernel_sem);
+ if (panic_timeout) {
+ while (down_trylock(&kernel_sem))
+ cpu_relax();
+ } else {
+ down(&kernel_sem);
+ }
preempt_disable();
task->lock_depth = saved_lock_depth;
@@ -67,11 +72,17 @@ void __lockfunc lock_kernel(void)
struct task_struct *task = current;
int depth = task->lock_depth + 1;
- if (likely(!depth))
+ if (likely(!depth)) {
/*
* No recursion worries - we set up lock_depth _after_
*/
- down(&kernel_sem);
+ if (panic_timeout) {
+ while (down_trylock(&kernel_sem))
+ cpu_relax();
+ } else {
+ down(&kernel_sem);
+ }
+ }
task->lock_depth = depth;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists