15 #include <linux/kernel.h>
24 #define FRACTION_OF_NODE_MEM 16
26 static unsigned long max_pages(
unsigned long min_pages)
28 unsigned long node_free_pages,
max;
34 #ifdef CONFIG_ZONE_DMA
37 #ifdef CONFIG_ZONE_DMA32
45 max /= num_cpus_on_node;
47 return max(max, min_pages);
50 static long min_pages_to_free(
struct quicklist *
q,
51 unsigned long min_pages,
long max_free)
55 pages_to_free = q->nr_pages - max_pages(min_pages);
57 return min(pages_to_free, max_free);
64 unsigned long min_pages,
unsigned long max_free)
70 if (q->nr_pages > min_pages) {
71 pages_to_free = min_pages_to_free(q, min_pages, max_free);
73 while (pages_to_free > 0) {
78 void *
p = quicklist_alloc(nr, 0,
NULL);
91 unsigned long count = 0;
93 struct quicklist *ql, *
q;
97 for (q = ql; q < ql + CONFIG_NR_QUICK; q++)