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]
Message-ID: <alpine.LFD.2.00.0911302206370.24119@localhost.localdomain>
Date:	Mon, 30 Nov 2009 22:12:45 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Ingo Molnar <mingo@...e.hu>
cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Christoph Hellwig <hch@...radead.org>,
	Nick Piggin <npiggin@...e.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [rfc] "fair" rw spinlocks

On Mon, 30 Nov 2009, Ingo Molnar wrote:
> * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> 
> > On Mon, 30 Nov 2009, Christoph Hellwig wrote:
> > > 
> > > How long will this use be around?  I've seen some slow progress toward
> > > replacing most read side uses of the task list lock with RCU.  While we
> > > still have lots of read side users now I wonder when they'll go away.
> > 
> > tasklist_lock is pretty nasty. I threw out "replace it with RCU" 
> > because it would be nice, but the data structures used are not just 
> > simple linked lists that we have RCU helpers for traversing.
> > 
> > There are various real exclusion rules about things like 
> > 'tsk->exit_state' etc, which do not translate directly to RCU usage. 
> > Of course, _maybe_ all the places that care already take the thing for 
> > writing and would just automatically have exclusion anyway.
> > 
> > So I'd love to see somebody try to do the conversion. To a first 
> > approximation, you probably could do
> > 
> >  - turn tasklist_lock into a spinlock
> > 
> >  - sed 's/write_lock_irq(&tasklist_lock)/spin_lock(&tasklist_lock)/g'
> >    sed 's/write_unlock_irq(&tasklist_lock)/spin_unlock(&tasklist_lock)/g'
> > 
> >  - sed 's/read_lock(&tasklist_lock)/rcu_read_lock()/g'
> >    sed 's/read_unlock(&tasklist_lock)/rcu_read_unlock()/g'
> > 
> >  - make all the task lists use the RCU versions of the list routines
> > 
> >  - free the task structure using RCU
> > 
> > and you'd be _pretty_ close to a working system.
> 
> In -rt we've got that in essence, and it's indeed working fine (with a 
> few caveats). A few RCU conversions of tasklist_lock usage in that area 
> even trickled upstream, because the simple lock would hurt so much under 
> -rt.

I think the conversion Linus proposed is pretty feasible. I went
through the read_lock sites and most of them are protecting function
calls which we already use under rcu_read_lock() in other places like
find_task* and thread or pid iterators.

There are a few non obvious ones in signal.c and posix-cpu-timers.c
(what a surprise) but nothing looks too scary.

If nobody beats me I'm going to let sed loose on the kernel, lift the
task_struct rcu free code from -rt and figure out what explodes.

Thanks,

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