Lines Matching full:acc
28 * get a cache hit, we increment a single atomic_t in acc->collector, and when
96 int bch_cache_accounting_add_kobjs(struct cache_accounting *acc, in bch_cache_accounting_add_kobjs() argument
99 int ret = kobject_add(&acc->total.kobj, parent, in bch_cache_accounting_add_kobjs()
101 ret = ret ?: kobject_add(&acc->five_minute.kobj, parent, in bch_cache_accounting_add_kobjs()
103 ret = ret ?: kobject_add(&acc->hour.kobj, parent, in bch_cache_accounting_add_kobjs()
105 ret = ret ?: kobject_add(&acc->day.kobj, parent, in bch_cache_accounting_add_kobjs()
110 void bch_cache_accounting_clear(struct cache_accounting *acc) in bch_cache_accounting_clear() argument
112 acc->total.cache_hits = 0; in bch_cache_accounting_clear()
113 acc->total.cache_misses = 0; in bch_cache_accounting_clear()
114 acc->total.cache_bypass_hits = 0; in bch_cache_accounting_clear()
115 acc->total.cache_bypass_misses = 0; in bch_cache_accounting_clear()
116 acc->total.cache_readaheads = 0; in bch_cache_accounting_clear()
117 acc->total.cache_miss_collisions = 0; in bch_cache_accounting_clear()
118 acc->total.sectors_bypassed = 0; in bch_cache_accounting_clear()
121 void bch_cache_accounting_destroy(struct cache_accounting *acc) in bch_cache_accounting_destroy() argument
123 kobject_put(&acc->total.kobj); in bch_cache_accounting_destroy()
124 kobject_put(&acc->five_minute.kobj); in bch_cache_accounting_destroy()
125 kobject_put(&acc->hour.kobj); in bch_cache_accounting_destroy()
126 kobject_put(&acc->day.kobj); in bch_cache_accounting_destroy()
128 atomic_set(&acc->closing, 1); in bch_cache_accounting_destroy()
129 if (del_timer_sync(&acc->timer)) in bch_cache_accounting_destroy()
130 closure_return(&acc->cl); in bch_cache_accounting_destroy()
156 struct cache_accounting *acc = from_timer(acc, t, timer); in scale_accounting() local
159 unsigned int t = atomic_xchg(&acc->collector.name, 0); \ in scale_accounting()
161 acc->five_minute.name += t; \ in scale_accounting()
162 acc->hour.name += t; \ in scale_accounting()
163 acc->day.name += t; \ in scale_accounting()
164 acc->total.name += t; \ in scale_accounting()
175 scale_stats(&acc->total, 0); in scale_accounting()
176 scale_stats(&acc->day, DAY_RESCALE); in scale_accounting()
177 scale_stats(&acc->hour, HOUR_RESCALE); in scale_accounting()
178 scale_stats(&acc->five_minute, FIVE_MINUTE_RESCALE); in scale_accounting()
180 acc->timer.expires += accounting_delay; in scale_accounting()
182 if (!atomic_read(&acc->closing)) in scale_accounting()
183 add_timer(&acc->timer); in scale_accounting()
185 closure_return(&acc->cl); in scale_accounting()
235 void bch_cache_accounting_init(struct cache_accounting *acc, in bch_cache_accounting_init() argument
238 kobject_init(&acc->total.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
239 kobject_init(&acc->five_minute.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
240 kobject_init(&acc->hour.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
241 kobject_init(&acc->day.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
243 closure_init(&acc->cl, parent); in bch_cache_accounting_init()
244 timer_setup(&acc->timer, scale_accounting, 0); in bch_cache_accounting_init()
245 acc->timer.expires = jiffies + accounting_delay; in bch_cache_accounting_init()
246 add_timer(&acc->timer); in bch_cache_accounting_init()