Lines Matching refs:counter
47 static inline void page_counter_init(struct page_counter *counter, in page_counter_init() argument
50 atomic_long_set(&counter->usage, 0); in page_counter_init()
51 counter->max = PAGE_COUNTER_MAX; in page_counter_init()
52 counter->parent = parent; in page_counter_init()
55 static inline unsigned long page_counter_read(struct page_counter *counter) in page_counter_read() argument
57 return atomic_long_read(&counter->usage); in page_counter_read()
60 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages);
61 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages);
62 bool page_counter_try_charge(struct page_counter *counter,
65 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages);
66 void page_counter_set_min(struct page_counter *counter, unsigned long nr_pages);
67 void page_counter_set_low(struct page_counter *counter, unsigned long nr_pages);
69 static inline void page_counter_set_high(struct page_counter *counter, in page_counter_set_high() argument
72 WRITE_ONCE(counter->high, nr_pages); in page_counter_set_high()
75 int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages);
79 static inline void page_counter_reset_watermark(struct page_counter *counter) in page_counter_reset_watermark() argument
81 counter->watermark = page_counter_read(counter); in page_counter_reset_watermark()