/* * We keep absolute totals of various statistics, and addionally a set of three * rolling averages. * * Every so often, a timer goes off and rescales the rolling averages. * accounting_rescale[] is how many times the timer has to go off before we * rescale each set of numbers; that gets us half lives of 5 minutes, one hour, * and one day. * * accounting_delay is how often the timer goes off - 22 times in 5 minutes, * and accounting_weight is what we use to rescale: * * pow(31 / 32, 22) ~= 1/2 * * So that we don't have to increment each set of numbers every time we (say) * get a cache hit, we increment a single atomic_t in acc->collector, and when * the rescale function runs it resets the atomic counter to 0 and adds its * old value to each of the exported numbers. * * To reduce rounding error, the numbers in struct cache_stats are all * stored left shifted by 16, and scaled back in the sysfs show() function.
*/
int bch_cache_accounting_add_kobjs(struct cache_accounting *acc, struct kobject *parent)
{ int ret = kobject_add(&acc->total.kobj, parent, "stats_total");
ret = ret ?: kobject_add(&acc->five_minute.kobj, parent, "stats_five_minute");
ret = ret ?: kobject_add(&acc->hour.kobj, parent, "stats_hour");
ret = ret ?: kobject_add(&acc->day.kobj, parent, "stats_day"); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.