• Julian Anastasov's avatar
    ipvs: properly zero stats and rates · 55a3d4e1
    Julian Anastasov authored
     	Currently, the new percpu counters are not zeroed and
    the zero commands do not work as expected, we still show the old
    sum of percpu values. OTOH, we can not reset the percpu counters
    from user context without causing the incrementing to use old
    and bogus values.
    
     	So, as Eric Dumazet suggested fix that by moving all overhead
    to stats reading in user context. Do not introduce overhead in
    timer context (estimator) and incrementing (packet handling in
    softirqs).
    
     	The new ustats0 field holds the zero point for all
    counter values, the rates always use 0 as base value as before.
    When showing the values to user space just give the difference
    between counters and the base values. The only drawback is that
    percpu stats are not zeroed, they are accessible only from /proc
    and are new interface, so it should not be a compatibility problem
    as long as the sum stats are correct after zeroing.
    Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
    Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
    55a3d4e1
ip_vs.h 39.3 KB