Subject: Re: [PATCH net-next] xfrm: Namespacify xfrm_policy_sk_bundles

From: Fan Du <[email-masked]>
Date: Tue, 17 Dec 2013 09:45:46 +0800

On 2013年12月16日 20:23, Steffen Klassert wrote:
> On Mon, Dec 16, 2013 at 06:26:08PM +0800, Fan Du wrote:
>>
>> And also since xfrm_policy_sk_bundles is only used in xfrm_lookup and
>> __xfrm_garbage_collect, both in process context, no reason we should turn
>> BH off.
>
> Are you sure about that?
>
> __xfrm_garbage_collect() is called via dst_alloc() which can be called
> from softirq and process context.

Thanks for pointing this out, you are correct! :)

IMO, xchg can still cover those two cases:
1. xfrm_lookup(Process context)  vs  __xfrm_garbage_collect(softirq context)
2. xfrm_lookup(Process context)  vs  __xfrm_garbage_collect(Process context when SPD change or dev down)

I will fix commit message properly on v2 if you are ok with above description.

>> In addition we can use xchg to avoid the spinlock, inspired by
>> discussion in: http://marc.info/?l=linux-netdev&m=138713363113003&w=2
>>
>> Signed-off-by: Fan Du<[email-masked]>
>> ---
>> Please note this patch is based on commit 283bc9f35bbbcb0e9ab4e6d2427da7f9f710d52d
>> ("xfrm: Namespacify xfrm state/policy locks"), which is still in ipsec-next tree.
>>
>
> You could use
>
> Subject: [PATCH ipsec-next] xfrm: Namespacify xfrm_policy_sk_bundles
>
> then everybody should know on which tree it is based.
>
>

-- 
浮沉随浪只记今朝笑

--fan