Lines Matching refs:p
38 int fprop_global_init(struct fprop_global *p, gfp_t gfp) in fprop_global_init() argument
42 p->period = 0; in fprop_global_init()
44 err = percpu_counter_init(&p->events, 1, gfp); in fprop_global_init()
47 seqcount_init(&p->sequence); in fprop_global_init()
51 void fprop_global_destroy(struct fprop_global *p) in fprop_global_destroy() argument
53 percpu_counter_destroy(&p->events); in fprop_global_destroy()
64 bool fprop_new_period(struct fprop_global *p, int periods) in fprop_new_period() argument
66 s64 events = percpu_counter_sum(&p->events); in fprop_new_period()
74 write_seqcount_begin(&p->sequence); in fprop_new_period()
78 percpu_counter_add(&p->events, -events); in fprop_new_period()
79 p->period += periods; in fprop_new_period()
80 write_seqcount_end(&p->sequence); in fprop_new_period()
108 static void fprop_reflect_period_percpu(struct fprop_global *p, in fprop_reflect_period_percpu() argument
111 unsigned int period = p->period; in fprop_reflect_period_percpu()
139 void __fprop_add_percpu(struct fprop_global *p, struct fprop_local_percpu *pl, in __fprop_add_percpu() argument
142 fprop_reflect_period_percpu(p, pl); in __fprop_add_percpu()
144 percpu_counter_add(&p->events, nr); in __fprop_add_percpu()
147 void fprop_fraction_percpu(struct fprop_global *p, in fprop_fraction_percpu() argument
155 seq = read_seqcount_begin(&p->sequence); in fprop_fraction_percpu()
156 fprop_reflect_period_percpu(p, pl); in fprop_fraction_percpu()
158 den = percpu_counter_read_positive(&p->events); in fprop_fraction_percpu()
159 } while (read_seqcount_retry(&p->sequence, seq)); in fprop_fraction_percpu()
179 void __fprop_add_percpu_max(struct fprop_global *p, in __fprop_add_percpu_max() argument
186 fprop_fraction_percpu(p, pl, &numerator, &denominator); in __fprop_add_percpu_max()
200 __fprop_add_percpu(p, pl, nr); in __fprop_add_percpu_max()