Lines Matching refs:acc

94 int bch_cache_accounting_add_kobjs(struct cache_accounting *acc,  in bch_cache_accounting_add_kobjs()  argument
97 int ret = kobject_add(&acc->total.kobj, parent, in bch_cache_accounting_add_kobjs()
99 ret = ret ?: kobject_add(&acc->five_minute.kobj, parent, in bch_cache_accounting_add_kobjs()
101 ret = ret ?: kobject_add(&acc->hour.kobj, parent, in bch_cache_accounting_add_kobjs()
103 ret = ret ?: kobject_add(&acc->day.kobj, parent, in bch_cache_accounting_add_kobjs()
108 void bch_cache_accounting_clear(struct cache_accounting *acc) in bch_cache_accounting_clear() argument
110 acc->total.cache_hits = 0; in bch_cache_accounting_clear()
111 acc->total.cache_misses = 0; in bch_cache_accounting_clear()
112 acc->total.cache_bypass_hits = 0; in bch_cache_accounting_clear()
113 acc->total.cache_bypass_misses = 0; in bch_cache_accounting_clear()
114 acc->total.cache_miss_collisions = 0; in bch_cache_accounting_clear()
115 acc->total.sectors_bypassed = 0; in bch_cache_accounting_clear()
118 void bch_cache_accounting_destroy(struct cache_accounting *acc) in bch_cache_accounting_destroy() argument
120 kobject_put(&acc->total.kobj); in bch_cache_accounting_destroy()
121 kobject_put(&acc->five_minute.kobj); in bch_cache_accounting_destroy()
122 kobject_put(&acc->hour.kobj); in bch_cache_accounting_destroy()
123 kobject_put(&acc->day.kobj); in bch_cache_accounting_destroy()
125 atomic_set(&acc->closing, 1); in bch_cache_accounting_destroy()
126 if (del_timer_sync(&acc->timer)) in bch_cache_accounting_destroy()
127 closure_return(&acc->cl); in bch_cache_accounting_destroy()
152 struct cache_accounting *acc = from_timer(acc, t, timer); in scale_accounting() local
155 unsigned int t = atomic_xchg(&acc->collector.name, 0); \ in scale_accounting()
157 acc->five_minute.name += t; \ in scale_accounting()
158 acc->hour.name += t; \ in scale_accounting()
159 acc->day.name += t; \ in scale_accounting()
160 acc->total.name += t; \ in scale_accounting()
170 scale_stats(&acc->total, 0); in scale_accounting()
171 scale_stats(&acc->day, DAY_RESCALE); in scale_accounting()
172 scale_stats(&acc->hour, HOUR_RESCALE); in scale_accounting()
173 scale_stats(&acc->five_minute, FIVE_MINUTE_RESCALE); in scale_accounting()
175 acc->timer.expires += accounting_delay; in scale_accounting()
177 if (!atomic_read(&acc->closing)) in scale_accounting()
178 add_timer(&acc->timer); in scale_accounting()
180 closure_return(&acc->cl); in scale_accounting()
222 void bch_cache_accounting_init(struct cache_accounting *acc, in bch_cache_accounting_init() argument
225 kobject_init(&acc->total.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
226 kobject_init(&acc->five_minute.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
227 kobject_init(&acc->hour.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
228 kobject_init(&acc->day.kobj, &bch_stats_ktype); in bch_cache_accounting_init()
230 closure_init(&acc->cl, parent); in bch_cache_accounting_init()
231 timer_setup(&acc->timer, scale_accounting, 0); in bch_cache_accounting_init()
232 acc->timer.expires = jiffies + accounting_delay; in bch_cache_accounting_init()
233 add_timer(&acc->timer); in bch_cache_accounting_init()