Re: [PATCH 02/20] ipvs: reorganize tot_stats

Julian Anastasov
2011-03-14T09:21:21Z

Hello,

On Mon, 14 Mar 2011, Eric Dumazet wrote:

>> Also, make sure ip_vs_stats_percpu_show reads properly
>> the u64 stats from user context.
>>
>> Signed-off-by: Julian Anastasov <ja@ssi.bg>
>> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> One comment : per cpu stats are really good to avoid cache misses, but I
> see tot_stats is included in struct netns_ipvs right after "conn_count",
> possibly sharing a hot cache line ?

conn_count and tcp_app_lock, udp_app_lock, sctp_app_lock
are used when packet creates new connection, probably on the
same time depending on the protocol in packet. May be conn_count
better to be before tcp_apps, far away from some sysctl vars
that are mostly read?

For tot_stats: cpustats ptr is always read,
other fields in tot_stats are updated from the 2-second
timer. May be it is better just to move tot_stats before
est_list, it is written at the same time?

Regards

--
Julian Anastasov <ja@ssi.bg>