Lines Matching full:pl
91 int fprop_local_init_percpu(struct fprop_local_percpu *pl, gfp_t gfp) in fprop_local_init_percpu() argument
95 err = percpu_counter_init(&pl->events, 0, gfp); in fprop_local_init_percpu()
98 pl->period = 0; in fprop_local_init_percpu()
99 raw_spin_lock_init(&pl->lock); in fprop_local_init_percpu()
103 void fprop_local_destroy_percpu(struct fprop_local_percpu *pl) in fprop_local_destroy_percpu() argument
105 percpu_counter_destroy(&pl->events); in fprop_local_destroy_percpu()
109 struct fprop_local_percpu *pl) in fprop_reflect_period_percpu() argument
115 if (pl->period == period) in fprop_reflect_period_percpu()
117 raw_spin_lock_irqsave(&pl->lock, flags); in fprop_reflect_period_percpu()
118 /* Someone updated pl->period while we were spinning? */ in fprop_reflect_period_percpu()
119 if (pl->period >= period) { in fprop_reflect_period_percpu()
120 raw_spin_unlock_irqrestore(&pl->lock, flags); in fprop_reflect_period_percpu()
124 if (period - pl->period < BITS_PER_LONG) { in fprop_reflect_period_percpu()
125 s64 val = percpu_counter_read(&pl->events); in fprop_reflect_period_percpu()
128 val = percpu_counter_sum(&pl->events); in fprop_reflect_period_percpu()
130 percpu_counter_add_batch(&pl->events, in fprop_reflect_period_percpu()
131 -val + (val >> (period-pl->period)), PROP_BATCH); in fprop_reflect_period_percpu()
133 percpu_counter_set(&pl->events, 0); in fprop_reflect_period_percpu()
134 pl->period = period; in fprop_reflect_period_percpu()
135 raw_spin_unlock_irqrestore(&pl->lock, flags); in fprop_reflect_period_percpu()
138 /* Event of type pl happened */
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()
143 percpu_counter_add_batch(&pl->events, nr, PROP_BATCH); in __fprop_add_percpu()
148 struct fprop_local_percpu *pl, in fprop_fraction_percpu() argument
156 fprop_reflect_period_percpu(p, pl); in fprop_fraction_percpu()
157 num = percpu_counter_read_positive(&pl->events); in fprop_fraction_percpu()
180 struct fprop_local_percpu *pl, int max_frac, long nr) 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()