lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 08 May 2008 15:14:43 +0800
From:	"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>,
	Matthew Wilcox <matthew@....cx>,
	LKML <linux-kernel@...r.kernel.org>,
	Alexander Viro <viro@....linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: AIM7 40% regression with 2.6.26-rc1


On Thu, 2008-05-08 at 08:43 +0200, Ingo Molnar wrote:
> * Zhang, Yanmin <yanmin_zhang@...ux.intel.com> wrote:
> 
> > > Here's a trial balloon patch to do that.
> > > 
> > > Yanmin - this is not well tested, but the code is fairly obvious, 
> > > and it would be interesting to hear if this fixes the performance 
> > > regression. Because if it doesn't, then it's not the BKL, or 
> > > something totally different is going on.
> >
> > Congratulations! The patch really fixes the regression completely! 
> > vmstat showed cpu idle is 0%, just like 2.6.25's.
> 
> great! Yanmin, could you please also check the other patch i sent (also 
> attached below), does it solve the regression similarly?
With your patch, aim7 regression becomes less than 2%. I ran the testing twice.

Linus' patch could recover it completely. As aim7 result is quite stable(usually
fluctuating less than 1%), 1.5%~2% is a little big.

> 
> 	Ingo
> 
> ---
>  lib/kernel_lock.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> Index: linux/lib/kernel_lock.c
> ===================================================================
> --- linux.orig/lib/kernel_lock.c
> +++ linux/lib/kernel_lock.c
> @@ -46,7 +46,8 @@ int __lockfunc __reacquire_kernel_lock(v
>  	task->lock_depth = -1;
>  	preempt_enable_no_resched();
>  
> -	down(&kernel_sem);
> +	while (down_trylock(&kernel_sem))
> +		cpu_relax();
>  
>  	preempt_disable();
>  	task->lock_depth = saved_lock_depth;
> @@ -67,11 +68,13 @@ 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);
> +		while (down_trylock(&kernel_sem))
> +			cpu_relax();
> +	}
>  
>  	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