Lines Matching full:nr

62 static long cmm_alloc_pages(long nr, long *counter,  in cmm_alloc_pages()  argument
68 while (nr) { in cmm_alloc_pages()
97 nr--; in cmm_alloc_pages()
100 return nr; in cmm_alloc_pages()
103 static long __cmm_free_pages(long nr, long *counter, struct cmm_page_array **list) in __cmm_free_pages() argument
110 while (nr) { in __cmm_free_pages()
121 nr--; in __cmm_free_pages()
124 return nr; in __cmm_free_pages()
127 static long cmm_free_pages(long nr, long *counter, struct cmm_page_array **list) in cmm_free_pages() argument
131 while (nr) { in cmm_free_pages()
132 inc = min(256L, nr); in cmm_free_pages()
133 nr -= inc; in cmm_free_pages()
139 return nr + inc; in cmm_free_pages()
146 long nr = 256; in cmm_oom_notify() local
148 nr = cmm_free_pages(nr, &cmm_timed_pages, &cmm_timed_page_list); in cmm_oom_notify()
149 if (nr > 0) in cmm_oom_notify()
150 nr = cmm_free_pages(nr, &cmm_pages, &cmm_page_list); in cmm_oom_notify()
153 *freed += 256 - nr; in cmm_oom_notify()
212 long nr; in cmm_timer_fn() local
214 nr = cmm_timed_pages_target - cmm_timeout_pages; in cmm_timer_fn()
215 if (nr < 0) in cmm_timer_fn()
218 cmm_timed_pages_target = nr; in cmm_timer_fn()
223 static void cmm_set_pages(long nr) in cmm_set_pages() argument
225 cmm_pages_target = nr; in cmm_set_pages()
234 static void cmm_add_timed_pages(long nr) in cmm_add_timed_pages() argument
236 cmm_timed_pages_target += nr; in cmm_add_timed_pages()
245 static void cmm_set_timeout(long nr, long seconds) in cmm_set_timeout() argument
247 cmm_timeout_pages = nr; in cmm_set_timeout()
265 long nr = cmm_get_pages(); in cmm_pages_handler() local
268 .data = &nr, in cmm_pages_handler()
277 cmm_set_pages(nr); in cmm_pages_handler()
285 long nr = cmm_get_timed_pages(); in cmm_timed_pages_handler() local
288 .data = &nr, in cmm_timed_pages_handler()
297 cmm_add_timed_pages(nr); in cmm_timed_pages_handler()
305 long nr, seconds; in cmm_timeout_handler() local
318 nr = simple_strtoul(p, &p, 0); in cmm_timeout_handler()
321 cmm_set_timeout(nr, seconds); in cmm_timeout_handler()
357 long nr, seconds; in cmm_smsg_target() local
366 nr = simple_strtoul(msg, &msg, 0); in cmm_smsg_target()
369 cmm_set_pages(nr); in cmm_smsg_target()
373 nr = simple_strtoul(msg, &msg, 0); in cmm_smsg_target()
376 cmm_add_timed_pages(nr); in cmm_smsg_target()
380 nr = simple_strtoul(msg, &msg, 0); in cmm_smsg_target()
386 cmm_set_timeout(nr, seconds); in cmm_smsg_target()