Lines Matching refs:page

49 static void FASTCALL(__free_pages_ok (struct page *page, unsigned int order));
52 struct page * free_pages_ok_no_irq_head;
56 struct page * page, * __page; in do_free_pages_ok_no_irq() local
60 page = free_pages_ok_no_irq_head; in do_free_pages_ok_no_irq()
65 while (page) { in do_free_pages_ok_no_irq()
66 __page = page; in do_free_pages_ok_no_irq()
67 page = page->next_hash; in do_free_pages_ok_no_irq()
80 #define BAD_RANGE(zone, page) \ argument
82 (((page) - mem_map) >= ((zone)->zone_start_mapnr+(zone)->size)) \
83 || (((page) - mem_map) < (zone)->zone_start_mapnr) \
84 || ((zone) != page_zone(page)) \
112 static void fastcall __free_pages_ok (struct page *page, unsigned int order) in __free_pages_ok() argument
116 struct page *base; in __free_pages_ok()
123 if (PageLRU(page)) { in __free_pages_ok()
128 page->next_hash = free_pages_ok_no_irq_head; in __free_pages_ok()
129 free_pages_ok_no_irq_head = page; in __free_pages_ok()
130 page->index = order; in __free_pages_ok()
138 lru_cache_del(page); in __free_pages_ok()
141 if (page->buffers) in __free_pages_ok()
143 if (page->mapping) in __free_pages_ok()
145 if (!VALID_PAGE(page)) in __free_pages_ok()
147 if (PageLocked(page)) in __free_pages_ok()
149 if (PageActive(page)) in __free_pages_ok()
151 ClearPageReferenced(page); in __free_pages_ok()
152 ClearPageDirty(page); in __free_pages_ok()
158 zone = page_zone(page); in __free_pages_ok()
162 page_idx = page - base; in __free_pages_ok()
174 struct page *buddy1, *buddy2; in __free_pages_ok()
212 list_add(&page->list, &current->local_pages); in __free_pages_ok()
213 page->index = order; in __free_pages_ok()
220 static inline struct page * expand (zone_t *zone, struct page *page, in expand() argument
226 if (BAD_RANGE(zone,page)) in expand()
231 list_add(&(page)->list, &(area)->free_list); in expand()
234 page += size; in expand()
236 if (BAD_RANGE(zone,page)) in expand()
238 return page; in expand()
241 static FASTCALL(struct page * rmqueue(zone_t *zone, unsigned int order));
242 static struct page * fastcall rmqueue(zone_t *zone, unsigned int order) in rmqueue()
248 struct page *page; in rmqueue() local
258 page = list_entry(curr, struct page, list); in rmqueue()
259 if (BAD_RANGE(zone,page)) in rmqueue()
262 index = page - zone->zone_mem_map; in rmqueue()
267 page = expand(zone, page, index, order, curr_order, area); in rmqueue()
270 set_page_count(page, 1); in rmqueue()
271 if (BAD_RANGE(zone,page)) in rmqueue()
273 if (PageLRU(page)) in rmqueue()
275 if (PageActive(page)) in rmqueue()
277 return page; in rmqueue()
288 struct page * fastcall _alloc_pages(unsigned int gfp_mask, unsigned int order) in _alloc_pages()
295 static struct page * FASTCALL(balance_classzone(zone_t *, unsigned int, unsigned int, int *));
296 static struct page * fastcall balance_classzone(zone_t * classzone, unsigned int gfp_mask, unsigned… in balance_classzone()
298 struct page * page = NULL; in balance_classzone() local
313 struct page * tmp; in balance_classzone()
322 tmp = list_entry(entry, struct page, list); in balance_classzone()
327 page = tmp; in balance_classzone()
329 if (page->buffers) in balance_classzone()
331 if (page->mapping) in balance_classzone()
333 if (!VALID_PAGE(page)) in balance_classzone()
335 if (PageLocked(page)) in balance_classzone()
337 if (PageLRU(page)) in balance_classzone()
339 if (PageActive(page)) in balance_classzone()
341 if (PageDirty(page)) in balance_classzone()
353 tmp = list_entry(entry, struct page, list); in balance_classzone()
362 return page; in balance_classzone()
374 struct page * fastcall __alloc_pages(unsigned int gfp_mask, unsigned int order, zonelist_t *zonelis… in __alloc_pages()
377 struct page * page; in __alloc_pages() local
390 page = rmqueue(z, order); in __alloc_pages()
391 if (page) in __alloc_pages()
392 return page; in __alloc_pages()
412 page = rmqueue(z, order); in __alloc_pages()
413 if (page) in __alloc_pages()
414 return page; in __alloc_pages()
428 page = rmqueue(z, order); in __alloc_pages()
429 if (page) in __alloc_pages()
430 return page; in __alloc_pages()
440 page = balance_classzone(classzone, gfp_mask, order, &freed); in __alloc_pages()
441 if (page) in __alloc_pages()
442 return page; in __alloc_pages()
452 page = rmqueue(z, order); in __alloc_pages()
453 if (page) in __alloc_pages()
454 return page; in __alloc_pages()
469 page = rmqueue(z, order); in __alloc_pages()
470 if (page) in __alloc_pages()
471 return page; in __alloc_pages()
489 struct page * page; in __get_free_pages() local
491 page = alloc_pages(gfp_mask, order); in __get_free_pages()
492 if (!page) in __get_free_pages()
494 return (unsigned long) page_address(page); in __get_free_pages()
499 struct page * page; in get_zeroed_page() local
501 page = alloc_pages(gfp_mask, 0); in get_zeroed_page()
502 if (page) { in get_zeroed_page()
503 void *address = page_address(page); in get_zeroed_page()
510 fastcall void __free_pages(struct page *page, unsigned int order) in __free_pages() argument
512 if (!PageReserved(page) && put_page_testzero(page)) in __free_pages()
513 __free_pages_ok(page, order); in __free_pages()
761 void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, in free_area_init_core()
763 unsigned long *zholes_size, struct page *lmem_map) in free_area_init_core()
792 map_size = (totalpages + 1)*sizeof(struct page); in free_area_init_core()
793 if (lmem_map == (struct page *)0) { in free_area_init_core()
794 lmem_map = (struct page *) alloc_bootmem_node(pgdat, map_size); in free_area_init_core()
795 lmem_map = (struct page *)(PAGE_OFFSET + in free_area_init_core()
888 struct page *page = mem_map + offset + i; in free_area_init_core() local
889 set_page_zone(page, nid * MAX_NR_ZONES + j); in free_area_init_core()
890 set_page_count(page, 0); in free_area_init_core()
891 SetPageReserved(page); in free_area_init_core()
892 INIT_LIST_HEAD(&page->list); in free_area_init_core()
894 set_page_address(page, __va(zone_start_paddr)); in free_area_init_core()