David Miller wrote:
From: Masahide NAKAMURA <[EMAIL PROTECTED]> 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 PROTECTED]>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 - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
