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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 30 Apr 2014 11:52:05 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	"Liu, Chuansheng" <chuansheng.liu@...el.com>
Cc:	"Wang, Xiaoming" <xiaoming.wang@...el.com>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lib/spinlock_debug: Tweak the loop time to fit different
 _delay()

On Wed, Apr 30, 2014 at 09:30:55AM +0000, Liu, Chuansheng wrote:
> > From: Peter Zijlstra [mailto:peterz@...radead.org]
> > Sent: Wednesday, April 30, 2014 4:55 PM
> > To: Wang, Xiaoming
> > Cc: mingo@...hat.com; linux-kernel@...r.kernel.org; Liu, Chuansheng
> > Subject: Re: [PATCH] lib/spinlock_debug: Tweak the loop time to fit different
> > _delay()
> > 
> > On Wed, Apr 30, 2014 at 06:40:38PM -0400, Wang, Xiaoming wrote:
> > > loops_per_jiffy*Hz  is not always 1 second exactly
> > > it depends on the realization of _delay() .
> > > delay_tsc is used as _delay() in arch/x86/lib/delay.c
> > 
> > This just states delay() is broken. The primary response should be to
> > try and fix that, no?
> 
> 
> delay(1s_count) is accurate, but delay(1) is not accurate indeed, since executing
> some instruction, then the 1 cycle delay maybe be used already.

OK, so there's (finally) a problem statement, so is there anything sane
we can do about that?

But yes, a trylock is a cmpxchg, and a cmpxchg on a contended cacheline
can be _much_ longer than one loop.

Now the real problem is coming up with something that'll work for all
architectures.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ