Scalable Statistics Counters

Release: 2.4.18

Developers: Dipankar Sarma, Ravikiran G. Thirumalai

Patched against: linux-2.4.18

Co-reqs / Pre-reqs: kernel.org 2.4.18 kernel

Changelog:

Apply statctr-2.4.18-5.patch first Then apply statctrusage-2.4.18-3.patch second. --------- In-kernel counters are used to collect statistics of various events and render the same on requests (Eg., total packets transmitted from a network interface, context swithces, disk usage statistics, etc). These counters are usually not serialised by any mutex, since such counters need to be reasonably accurate only. Depending on the purpose and load conditons, these counters may be be updated very frequently. In this document, a new set of interfaces are proposed, which should improve performance of such counters in multiprocessor environments. The basic idea behind the approach is to have per cpu versions of these counters and update per-cpu versions. The per cpu versions can be consolidated on a read request to the counter. This improves performance significantly in multiprocessor environments by reducing the bouncing of the counter cache lines among different CPUs. At the same time, this implementation switches to code that is completely devoid of overheads for SMP when compiled without CONFIG_SMP option set.