Lines Matching refs:nr_pages
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()
56 new, nr_pages)) { in page_counter_cancel()
70 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument
77 new = atomic_long_add_return(nr_pages, &c->usage); in page_counter_charge()
98 unsigned long nr_pages, in page_counter_try_charge() argument
119 new = atomic_long_add_return(nr_pages, &c->usage); in page_counter_try_charge()
121 atomic_long_sub(nr_pages, &c->usage); in page_counter_try_charge()
143 page_counter_cancel(c, nr_pages); in page_counter_try_charge()
153 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages) in page_counter_uncharge() argument
158 page_counter_cancel(c, nr_pages); in page_counter_uncharge()
171 int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages) in page_counter_set_max() argument
190 if (usage > nr_pages) 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()
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()
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()
247 unsigned long *nr_pages) in page_counter_memparse() argument
253 *nr_pages = PAGE_COUNTER_MAX; in page_counter_memparse()
261 *nr_pages = min(bytes / PAGE_SIZE, (u64)PAGE_COUNTER_MAX); in page_counter_memparse()