On 03/02/17 03:47, David Miller wrote:
> From: Nikolay Aleksandrov <[email protected]>
> Date: Tue, 31 Jan 2017 16:31:58 +0100
>
>> @@ -197,7 +197,8 @@ int br_handle_frame_finish(struct net *net, struct sock
>> *sk, struct sk_buff *skb
>> if (dst->is_local)
>> return br_pass_frame_up(skb);
>>
>> - dst->used = jiffies;
>> + if (br->used_enabled)
>> + dst->used = jiffies;
>
> Have you tried:
>
> if (dst->used != jiffies)
> dst->used = jiffies;
>
> If that isn't effective, you can tweak the test to decrease the
> granularity of the value. Basically, if dst->used is within
> 1 HZ of jiffies, don't do the write.
>
> I suspect this might help a lot, and not require a new bridging
> option.
>
After running a ton of tests with different granularity settings and
improvements
similar to:
br->jiffy_update_mask = rounddown_pow_of_two(clock_t_to_jiffies(1)) - 1
fast_path:
if (!(jiffies & br->jiffy_update_mask) && dst->used != jiffies)
dst->used = jiffies;
in order to bring down the updates even lower, it seems that just going with the
comparison is enough - I can't see any measurable win by bringing it even lower
(e.g.
HZ / USER_HZ granularity).
So I'm going with the simpler approach and just doing the comparison.
Thanks,
Nik