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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 05 May 2011 17:08:15 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	john stultz <johnstul@...ibm.com>,
	Andi Kleen <andi@...stfloor.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Paul Mackerras <paulus@...ba.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Anton Blanchard <anton@...ba.org>, Ingo Molnar <mingo@...e.hu>
Subject: Re: [RFC] time: xtime_lock is held too long

Le jeudi 05 mai 2011 à 16:39 +0200, Thomas Gleixner a écrit :
> On Thu, 5 May 2011, Eric Dumazet wrote:
> 
> > I feel xtime_lock seqlock is abused these days.
> > 
> > seqlock abstraction is somewhat lazy/dangerous because write_sequnlock()
> > does both the seqcount increment and spinlock release.
> > 
> > I am concerned by fact that readers might wait for long times, because
> > writers hold the whole seqlock, while sometime they only want to guard
> > other writers to come in.
> > 
> > Maybe it's time to separate the things (the seqcount and the spinlock)
> > so that writer can manipulate data in different sections : 
> > - Sections while holding spinlock, allowing "readers" to run
> > - Very small sections enclosed in a pair of seqcount increments, to
> > synchronize with readers.
> 
> Well, in the case of timekeeping that might be problematic. I'm not
> sure whether we can calculate the new values under the spinlock and
> then update the timekeeper under the seqlock because we might adjust
> the mult/shift pair which then can result in observabcle time going
> backwards problems. It might be worth a try, though. John ???
>  
> The only thing which really can move right away outside the xtime
> seqlock region is calc_global_load().
> 

That would be a start, but we also could have finer granularity in
locks :

update_vsyscall() has its own protection and could be done outside of
the seqcount inc pair used for ktime_get().

[ but my patch numbers were for a 32bit kernel, so vsyscall is not
accounted for. ]

Another idea would be to prime cache lines to be dirtied in cpu cache
before taking locks, and better pack variables to reduce number of cache
lines.



--
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