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: <20131125110500.GV3866@twins.programming.kicks-ass.net>
Date:	Mon, 25 Nov 2013 12:05:00 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>
Cc:	Marcelo Tosatti <mtosatti@...hat.com>, gleb@...hat.com,
	avi.kivity@...il.com, pbonzini@...hat.com,
	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	Eric Dumazet <dada1@...mosbay.com>
Subject: Re: [PATCH v3 07/15] KVM: MMU: introduce nulls desc

On Mon, Nov 25, 2013 at 06:59:24PM +0800, Xiao Guangrong wrote:
> 
> Hi Peter,
> 
> On 11/25/2013 05:31 PM, Peter Zijlstra wrote:
> > On Fri, Nov 22, 2013 at 05:14:29PM -0200, Marcelo Tosatti wrote:
> >> Also, there is no guarantee of termination (as long as sptes are
> >> deleted with the correct timing). BTW, can't see any guarantee of
> >> termination for rculist nulls either (a writer can race with a lockless
> >> reader indefinately, restarting the lockless walk every time).
> > 
> > What's an rculist null? 
> 
> I guess Marcelo was talking about rculist_nulls.h
> (Documentation/RCU/rculist_nulls.txt).

Oh, let me have a look, I don't think I've really looked at that yet.

> > rculists have regular termination conditions,
> > they'll reach the end (also head, due to circular etc..) in N steps,
> > where N is the number of elements.
> > 
> > Of course you can keep adding elements to protract this situation, but
> > you'll run out of memory eventually -- you also have to make sure to
> > insert them after the element being read, otherwise the iteration will
> > simply miss them.
> > 
> > Deleting an element preserves the element itself -- it has to be
> > RCU-freed to be part of an rculist, and the element also preserves its
> > fwd link, so any iterator will either not see the element, or if they're
> > at the element, they'll continue their iteration as normal (rculist
> > doesn't have backward iterators).
> > 
> > A deleted element may not be re-used before an RCU grace period has
> > lapsed. Same as for freeing such an element. So if you want to move an
> > rculist element you need to:
> > 
> >   list_del_rcu()
> >   synchronize_rcu();
> >   list_add_rcu();
> > 
> > Or use the list_splice_init_rcu() primitive which also explicitly takes
> > a @sync argument.
> 
> Thanks for your detailed explanation, Peter!
> 
> What about if the element is allocated from SLAB_DESTROY_BY_RCU slab? That
> means the element may be reused while do iteration.

Then its broken, SLAB_DESTROY_BY_RCU rarely does what people expect it
to; which is why I wrote that honkin' huge comment right next to it.


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