On 11/16/2018 06:34 AM, Eric Dumazet wrote:
>
>> + s64 tcfp_toks;
>> + s64 tcfp_ptoks;
>> + s64 tcfp_t_c;
>
> I suggest to use a single cache line with a dedicated spinlock and these
> three s64
>
> spinlock_t tcfp_lock ____cacheline_aligned_in_smp;
> s64 ...
> s64 ...
> s64 ...
>
>
>> struct tcf_police_params __rcu *params;
>
> Make sure to use a different cache line for *params
>
> struct tcf_police_params __rcu *params ____cacheline_aligned_in_smp;
Or move it before the cacheline used by the lock and three s64,
since 'common' should be read-mostly. No need for a separate cache line.