Lines Matching refs:counter
49 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages) in page_counter_cancel() argument
53 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel()
58 atomic_long_set(&counter->usage, new); in page_counter_cancel()
60 propagate_protected_usage(counter, new); in page_counter_cancel()
70 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument
74 for (c = counter; c; c = c->parent) { in page_counter_charge()
97 bool page_counter_try_charge(struct page_counter *counter, in page_counter_try_charge() argument
103 for (c = counter; c; c = c->parent) { in page_counter_try_charge()
142 for (c = counter; c != *fail; c = c->parent) in page_counter_try_charge()
153 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages) in page_counter_uncharge() argument
157 for (c = counter; c; c = c->parent) in page_counter_uncharge()
171 int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_max() argument
188 usage = page_counter_read(counter); in page_counter_set_max()
193 old = xchg(&counter->max, nr_pages); in page_counter_set_max()
195 if (page_counter_read(counter) <= usage || nr_pages >= old) in page_counter_set_max()
198 counter->max = old; in page_counter_set_max()
210 void page_counter_set_min(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_min() argument
214 WRITE_ONCE(counter->min, nr_pages); in page_counter_set_min()
216 for (c = counter; c; c = c->parent) in page_counter_set_min()
227 void page_counter_set_low(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_low() argument
231 WRITE_ONCE(counter->low, nr_pages); in page_counter_set_low()
233 for (c = counter; c; c = c->parent) in page_counter_set_low()