Subject: Re: [PATCH][XFRM] Fixes for net-2.6

From: Masahide NAKAMURA <[email-masked]>
Date: Wed, 04 Oct 2006 11:08:01 +0900

David Miller wrote:
> From: Masahide NAKAMURA <[email-masked]>
> Date: Tue, 03 Oct 2006 12:29:54 +0900
> 
>>     [XFRM] POLICY: Fix per-direction policy counter after flushing.
>>
>>     Currently when xfrm_policy_flush() is called per-direction
>>     policy counter is cleared. However flusing policy is performed
>>     for each type (i.e. main or sub) then it is not always true
>>     to make the counter zero.
>>
>>     Signed-off-by: Masahide NAKAMURA <[email-masked]>
> 
> The idea of this code is to avoid updating global state many
> many times during such a flush.  This can be expensive and
> cause much SMP cacheline activity as other cpus read the
> counter in the routing lookup path.

Thanks for the clarify. My patch should have included such cacheline
consideration.

> I think what I'll do is reimplement this patch so that a local
> variable is used to maintain how many entries were removed,
> and then simply subtract that counter from xfrm_policy_count[dir]
> at the very end where the assignment to zero occurs.

I feel it's better idea now. I agree to apply it instead of my patch.

Regards,

-- 
Masahide NAKAMURA