netdev
[Top] [All Lists]

Re: [IPSEC] Move xfrm_flush_bundles into xfrm_state GC

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [IPSEC] Move xfrm_flush_bundles into xfrm_state GC
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Thu, 31 Mar 2005 02:10:53 +0200
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>, James Morris <jmorris@xxxxxxxxxx>, YOSHIFUJI Hideaki <yoshfuji@xxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20050328233032.GA15369@xxxxxxxxxxxxxxxxxxx>
References: <20050214221006.GA18415@xxxxxxxxxxxxxxxxxxx> <20050214221200.GA18465@xxxxxxxxxxxxxxxxxxx> <20050214221433.GB18465@xxxxxxxxxxxxxxxxxxx> <20050214221607.GC18465@xxxxxxxxxxxxxxxxxxx> <424864CE.5060802@xxxxxxxxx> <20050328233032.GA15369@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.6) Gecko/20050324 Debian/1.7.6-1
Herbert Xu wrote:
The locking in xfrm_state/xfrm_policy has always struck me as being
an overkill.  A lot of the locks should be replaced by rules that
ensure the validity of most operations while a ref count is held.
Now I have an excuse to do just that :)

I agree, it really looks like slight overkill.

For 2.6.12 let's go for a simpler fix that breaks the dead lock.

__xfrm_state_delete does not need to flush the bundles immediately.
In fact, it is more efficient if we delay the flush to the GC worker
since the flush is not dependent on any particular xfrm state.  By
delaying it we can do one single flush even when you're deleteing
the entire xfrm state list.

Looks good to me.

Regards
Patrick

<Prev in Thread] Current Thread [Next in Thread>