Re: xfrm_state locking regression...
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2008-09-23 06:47:14
On Tue, Sep 23, 2008 at 09:25:16AM +0300, Timo Teräs wrote:
Something like this. I just compile tested, so I'm not sure if it actually works.
It is quite clever :)
The corresponding put is in _destroy(). Added it as a final thing to do so hopefully compiler optimizes tail recursion to iteration. (Seemed to do that in my case.)
Yeah we should open code this to be absolutely sure that we don't get killed by a stupid compiler. However, I think this is still open to the same problem that my patch had, i.e., if a dumper goes to sleep during the dump we may prevent entries from being freed indefinitely. Yes your idea is better in that we may only withhold say a fraction (depending on the order of deletion it could be anywhere from none to every entry) of the entries instead of all of them, but fundamentally the same issue is still there. Considering the fact that dumps require root privileges I'm not convinced as of yet that this is worth it. Hmm, could we perhaps go back to your original scheme of keeping everything on the list and see if we can use RCU to make it lockless instead? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt