Lines Matching refs:nr_pages
50 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages) in page_counter_cancel() argument
54 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel()
57 new, nr_pages)) { in page_counter_cancel()
71 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument
78 new = atomic_long_add_return(nr_pages, &c->usage); in page_counter_charge()
99 unsigned long nr_pages, in page_counter_try_charge() argument
120 new = atomic_long_add_return(nr_pages, &c->usage); in page_counter_try_charge()
122 atomic_long_sub(nr_pages, &c->usage); in page_counter_try_charge()
145 page_counter_cancel(c, nr_pages); in page_counter_try_charge()
155 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages) in page_counter_uncharge() argument
160 page_counter_cancel(c, nr_pages); in page_counter_uncharge()
173 int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_max() argument
192 if (usage > nr_pages) in page_counter_set_max()
195 old = xchg(&counter->max, nr_pages); in page_counter_set_max()
212 void page_counter_set_min(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_min() argument
216 WRITE_ONCE(counter->min, nr_pages); in page_counter_set_min()
229 void page_counter_set_low(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_low() argument
233 WRITE_ONCE(counter->low, nr_pages); in page_counter_set_low()
249 unsigned long *nr_pages) in page_counter_memparse() argument
255 *nr_pages = PAGE_COUNTER_MAX; in page_counter_memparse()
263 *nr_pages = min(bytes / PAGE_SIZE, (u64)PAGE_COUNTER_MAX); in page_counter_memparse()