1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* internal.h: mm/ internal definitions
4 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
7 #ifndef __MM_INTERNAL_H
8 #define __MM_INTERNAL_H
12 #include <linux/pagemap.h>
13 #include <linux/tracepoint-defs.h>
18 * The set of flags that only affect watermark checking and reclaim
19 * behaviour. This is used by the MM to obey the caller constraints
20 * about IO, FS and watermark checking while ignoring placement
21 * hints such as HIGHMEM usage.
23 #define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\
24 __GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NOFAIL|\
25 __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC|\
26 __GFP_ATOMIC|__GFP_NOLOCKDEP)
28 /* The GFP flags allowed during early boot */
29 #define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS))
31 /* Control allocation cpuset and node placement constraints */
32 #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
34 /* Do not use these with a slab allocator */
35 #define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK)
37 void page_writeback_init(void);
39 static inline void *folio_raw_mapping(struct folio *folio)
41 unsigned long mapping = (unsigned long)folio->mapping;
43 return (void *)(mapping & ~PAGE_MAPPING_FLAGS);
46 void __acct_reclaim_writeback(pg_data_t *pgdat, struct folio *folio,
48 static inline void acct_reclaim_writeback(struct folio *folio)
50 pg_data_t *pgdat = folio_pgdat(folio);
51 int nr_throttled = atomic_read(&pgdat->nr_writeback_throttled);
54 __acct_reclaim_writeback(pgdat, folio, nr_throttled);
57 static inline void wake_throttle_isolated(pg_data_t *pgdat)
59 wait_queue_head_t *wqh;
61 wqh = &pgdat->reclaim_wait[VMSCAN_THROTTLE_ISOLATED];
62 if (waitqueue_active(wqh))
66 vm_fault_t do_swap_page(struct vm_fault *vmf);
67 void folio_rotate_reclaimable(struct folio *folio);
68 bool __folio_end_writeback(struct folio *folio);
70 void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
71 unsigned long floor, unsigned long ceiling);
72 void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte);
75 void unmap_page_range(struct mmu_gather *tlb,
76 struct vm_area_struct *vma,
77 unsigned long addr, unsigned long end,
78 struct zap_details *details);
80 void do_page_cache_ra(struct readahead_control *, unsigned long nr_to_read,
81 unsigned long lookahead_size);
82 void force_page_cache_ra(struct readahead_control *, unsigned long nr);
83 static inline void force_page_cache_readahead(struct address_space *mapping,
84 struct file *file, pgoff_t index, unsigned long nr_to_read)
86 DEFINE_READAHEAD(ractl, file, &file->f_ra, mapping, index);
87 force_page_cache_ra(&ractl, nr_to_read);
90 unsigned find_lock_entries(struct address_space *mapping, pgoff_t start,
91 pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
92 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
93 pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
94 void filemap_free_folio(struct address_space *mapping, struct folio *folio);
95 int truncate_inode_folio(struct address_space *mapping, struct folio *folio);
96 bool truncate_inode_partial_folio(struct folio *folio, loff_t start,
100 * folio_evictable - Test whether a folio is evictable.
101 * @folio: The folio to test.
103 * Test whether @folio is evictable -- i.e., should be placed on
104 * active/inactive lists vs unevictable list.
106 * Reasons folio might not be evictable:
107 * 1. folio's mapping marked unevictable
108 * 2. One of the pages in the folio is part of an mlocked VMA
110 static inline bool folio_evictable(struct folio *folio)
114 /* Prevent address_space of inode and swap cache from being freed */
116 ret = !mapping_unevictable(folio_mapping(folio)) &&
117 !folio_test_mlocked(folio);
122 static inline bool page_evictable(struct page *page)
126 /* Prevent address_space of inode and swap cache from being freed */
128 ret = !mapping_unevictable(page_mapping(page)) && !PageMlocked(page);
134 * Turn a non-refcounted page (->_refcount == 0) into refcounted with
137 static inline void set_page_refcounted(struct page *page)
139 VM_BUG_ON_PAGE(PageTail(page), page);
140 VM_BUG_ON_PAGE(page_ref_count(page), page);
141 set_page_count(page, 1);
144 extern unsigned long highest_memmap_pfn;
147 * Maximum number of reclaim retries without progress before the OOM
148 * killer is consider the only way forward.
150 #define MAX_RECLAIM_RETRIES 16
155 extern int isolate_lru_page(struct page *page);
156 extern void putback_lru_page(struct page *page);
157 extern void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason);
162 extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
169 * Structure for holding the mostly immutable allocation parameters passed
170 * between functions involved in allocations, including the alloc_pages*
171 * family of functions.
173 * nodemask, migratetype and highest_zoneidx are initialized only once in
174 * __alloc_pages() and then never change.
176 * zonelist, preferred_zone and highest_zoneidx are set first in
177 * __alloc_pages() for the fast path, and might be later changed
178 * in __alloc_pages_slowpath(). All other functions pass the whole structure
179 * by a const pointer.
181 struct alloc_context {
182 struct zonelist *zonelist;
183 nodemask_t *nodemask;
184 struct zoneref *preferred_zoneref;
188 * highest_zoneidx represents highest usable zone index of
189 * the allocation request. Due to the nature of the zone,
190 * memory on lower zone than the highest_zoneidx will be
191 * protected by lowmem_reserve[highest_zoneidx].
193 * highest_zoneidx is also used by reclaim/compaction to limit
194 * the target zone since higher zone than this index cannot be
195 * usable for this allocation request.
197 enum zone_type highest_zoneidx;
198 bool spread_dirty_pages;
202 * Locate the struct page for both the matching buddy in our
203 * pair (buddy1) and the combined O(n+1) page they form (page).
205 * 1) Any buddy B1 will have an order O twin B2 which satisfies
206 * the following equation:
208 * For example, if the starting buddy (buddy2) is #8 its order
210 * B2 = 8 ^ (1 << 1) = 8 ^ 2 = 10
212 * 2) Any buddy B will have an order O+1 parent P which
213 * satisfies the following equation:
216 * Assumption: *_mem_map is contiguous at least up to MAX_ORDER
218 static inline unsigned long
219 __find_buddy_pfn(unsigned long page_pfn, unsigned int order)
221 return page_pfn ^ (1 << order);
224 extern struct page *__pageblock_pfn_to_page(unsigned long start_pfn,
225 unsigned long end_pfn, struct zone *zone);
227 static inline struct page *pageblock_pfn_to_page(unsigned long start_pfn,
228 unsigned long end_pfn, struct zone *zone)
230 if (zone->contiguous)
231 return pfn_to_page(start_pfn);
233 return __pageblock_pfn_to_page(start_pfn, end_pfn, zone);
236 extern int __isolate_free_page(struct page *page, unsigned int order);
237 extern void __putback_isolated_page(struct page *page, unsigned int order,
239 extern void memblock_free_pages(struct page *page, unsigned long pfn,
241 extern void __free_pages_core(struct page *page, unsigned int order);
242 extern void prep_compound_page(struct page *page, unsigned int order);
243 extern void post_alloc_hook(struct page *page, unsigned int order,
245 extern int user_min_free_kbytes;
247 extern void free_unref_page(struct page *page, unsigned int order);
248 extern void free_unref_page_list(struct list_head *list);
250 extern void zone_pcp_update(struct zone *zone, int cpu_online);
251 extern void zone_pcp_reset(struct zone *zone);
252 extern void zone_pcp_disable(struct zone *zone);
253 extern void zone_pcp_enable(struct zone *zone);
255 extern void *memmap_alloc(phys_addr_t size, phys_addr_t align,
256 phys_addr_t min_addr,
257 int nid, bool exact_nid);
259 #if defined CONFIG_COMPACTION || defined CONFIG_CMA
265 * compact_control is used to track pages being migrated and the free pages
266 * they are being migrated to during memory compaction. The free_pfn starts
267 * at the end of a zone and migrate_pfn begins at the start. Movable pages
268 * are moved to the end of a zone during a compaction run and the run
269 * completes when free_pfn <= migrate_pfn
271 struct compact_control {
272 struct list_head freepages; /* List of free pages to migrate to */
273 struct list_head migratepages; /* List of pages being migrated */
274 unsigned int nr_freepages; /* Number of isolated free pages */
275 unsigned int nr_migratepages; /* Number of pages to migrate */
276 unsigned long free_pfn; /* isolate_freepages search base */
278 * Acts as an in/out parameter to page isolation for migration.
279 * isolate_migratepages uses it as a search base.
280 * isolate_migratepages_block will update the value to the next pfn
281 * after the last isolated one.
283 unsigned long migrate_pfn;
284 unsigned long fast_start_pfn; /* a pfn to start linear scan from */
286 unsigned long total_migrate_scanned;
287 unsigned long total_free_scanned;
288 unsigned short fast_search_fail;/* failures to use free list searches */
289 short search_order; /* order to start a fast search at */
290 const gfp_t gfp_mask; /* gfp mask of a direct compactor */
291 int order; /* order a direct compactor needs */
292 int migratetype; /* migratetype of direct compactor */
293 const unsigned int alloc_flags; /* alloc flags of a direct compactor */
294 const int highest_zoneidx; /* zone index of a direct compactor */
295 enum migrate_mode mode; /* Async or sync migration mode */
296 bool ignore_skip_hint; /* Scan blocks even if marked skip */
297 bool no_set_skip_hint; /* Don't mark blocks for skipping */
298 bool ignore_block_suitable; /* Scan blocks considered unsuitable */
299 bool direct_compaction; /* False from kcompactd or /proc/... */
300 bool proactive_compaction; /* kcompactd proactive compaction */
301 bool whole_zone; /* Whole zone should/has been scanned */
302 bool contended; /* Signal lock or sched contention */
303 bool rescan; /* Rescanning the same pageblock */
304 bool alloc_contig; /* alloc_contig_range allocation */
308 * Used in direct compaction when a page should be taken from the freelists
309 * immediately when one is created during the free path.
311 struct capture_control {
312 struct compact_control *cc;
317 isolate_freepages_range(struct compact_control *cc,
318 unsigned long start_pfn, unsigned long end_pfn);
320 isolate_migratepages_range(struct compact_control *cc,
321 unsigned long low_pfn, unsigned long end_pfn);
323 int find_suitable_fallback(struct free_area *area, unsigned int order,
324 int migratetype, bool only_stealable, bool *can_steal);
327 * This function returns the order of a free page in the buddy system. In
328 * general, page_zone(page)->lock must be held by the caller to prevent the
329 * page from being allocated in parallel and returning garbage as the order.
330 * If a caller does not hold page_zone(page)->lock, it must guarantee that the
331 * page cannot be allocated or merged in parallel. Alternatively, it must
332 * handle invalid values gracefully, and use buddy_order_unsafe() below.
334 static inline unsigned int buddy_order(struct page *page)
336 /* PageBuddy() must be checked by the caller */
337 return page_private(page);
341 * Like buddy_order(), but for callers who cannot afford to hold the zone lock.
342 * PageBuddy() should be checked first by the caller to minimize race window,
343 * and invalid values must be handled gracefully.
345 * READ_ONCE is used so that if the caller assigns the result into a local
346 * variable and e.g. tests it for valid range before using, the compiler cannot
347 * decide to remove the variable and inline the page_private(page) multiple
348 * times, potentially observing different values in the tests and the actual
351 #define buddy_order_unsafe(page) READ_ONCE(page_private(page))
354 * These three helpers classifies VMAs for virtual memory accounting.
358 * Executable code area - executable, not writable, not stack
360 static inline bool is_exec_mapping(vm_flags_t flags)
362 return (flags & (VM_EXEC | VM_WRITE | VM_STACK)) == VM_EXEC;
366 * Stack area - automatically grows in one direction
368 * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous:
369 * do_mmap() forbids all other combinations.
371 static inline bool is_stack_mapping(vm_flags_t flags)
373 return (flags & VM_STACK) == VM_STACK;
377 * Data area - private, writable, not stack
379 static inline bool is_data_mapping(vm_flags_t flags)
381 return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE;
385 void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
386 struct vm_area_struct *prev);
387 void __vma_unlink_list(struct mm_struct *mm, struct vm_area_struct *vma);
390 void unmap_mapping_folio(struct folio *folio);
391 extern long populate_vma_page_range(struct vm_area_struct *vma,
392 unsigned long start, unsigned long end, int *locked);
393 extern long faultin_vma_page_range(struct vm_area_struct *vma,
394 unsigned long start, unsigned long end,
395 bool write, int *locked);
396 extern int mlock_future_check(struct mm_struct *mm, unsigned long flags,
399 * mlock_vma_page() and munlock_vma_page():
400 * should be called with vma's mmap_lock held for read or write,
401 * under page table lock for the pte/pmd being added or removed.
403 * mlock is usually called at the end of page_add_*_rmap(),
404 * munlock at the end of page_remove_rmap(); but new anon
405 * pages are managed by lru_cache_add_inactive_or_unevictable()
406 * calling mlock_new_page().
408 * @compound is used to include pmd mappings of THPs, but filter out
409 * pte mappings of THPs, which cannot be consistently counted: a pte
410 * mapping of the THP head cannot be distinguished by the page alone.
412 void mlock_page(struct page *page);
413 static inline void mlock_vma_page(struct page *page,
414 struct vm_area_struct *vma, bool compound)
417 * The VM_SPECIAL check here serves two purposes.
418 * 1) VM_IO check prevents migration from double-counting during mlock.
419 * 2) Although mmap_region() and mlock_fixup() take care that VM_LOCKED
420 * is never left set on a VM_SPECIAL vma, there is an interval while
421 * file->f_op->mmap() is using vm_insert_page(s), when VM_LOCKED may
422 * still be set while VM_SPECIAL bits are added: so ignore it then.
424 if (unlikely((vma->vm_flags & (VM_LOCKED|VM_SPECIAL)) == VM_LOCKED) &&
425 (compound || !PageTransCompound(page)))
428 void munlock_page(struct page *page);
429 static inline void munlock_vma_page(struct page *page,
430 struct vm_area_struct *vma, bool compound)
432 if (unlikely(vma->vm_flags & VM_LOCKED) &&
433 (compound || !PageTransCompound(page)))
436 void mlock_new_page(struct page *page);
437 bool need_mlock_page_drain(int cpu);
438 void mlock_page_drain(int cpu);
440 extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma);
443 * At what user virtual address is page expected in vma?
444 * Returns -EFAULT if all of the page is outside the range of vma.
445 * If page is a compound head, the entire compound page is considered.
447 static inline unsigned long
448 vma_address(struct page *page, struct vm_area_struct *vma)
451 unsigned long address;
453 VM_BUG_ON_PAGE(PageKsm(page), page); /* KSM page->index unusable */
454 pgoff = page_to_pgoff(page);
455 if (pgoff >= vma->vm_pgoff) {
456 address = vma->vm_start +
457 ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
458 /* Check for address beyond vma (or wrapped through 0?) */
459 if (address < vma->vm_start || address >= vma->vm_end)
461 } else if (PageHead(page) &&
462 pgoff + compound_nr(page) - 1 >= vma->vm_pgoff) {
463 /* Test above avoids possibility of wrap to 0 on 32-bit */
464 address = vma->vm_start;
472 * Then at what user virtual address will none of the page be found in vma?
473 * Assumes that vma_address() already returned a good starting address.
474 * If page is a compound head, the entire compound page is considered.
476 static inline unsigned long
477 vma_address_end(struct page *page, struct vm_area_struct *vma)
480 unsigned long address;
482 VM_BUG_ON_PAGE(PageKsm(page), page); /* KSM page->index unusable */
483 pgoff = page_to_pgoff(page) + compound_nr(page);
484 address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
485 /* Check for address beyond vma (or wrapped through 0?) */
486 if (address < vma->vm_start || address > vma->vm_end)
487 address = vma->vm_end;
491 static inline struct file *maybe_unlock_mmap_for_io(struct vm_fault *vmf,
494 int flags = vmf->flags;
500 * FAULT_FLAG_RETRY_NOWAIT means we don't want to wait on page locks or
501 * anything, so we only pin the file and drop the mmap_lock if only
502 * FAULT_FLAG_ALLOW_RETRY is set, while this is the first attempt.
504 if (fault_flag_allow_retry_first(flags) &&
505 !(flags & FAULT_FLAG_RETRY_NOWAIT)) {
506 fpin = get_file(vmf->vma->vm_file);
507 mmap_read_unlock(vmf->vma->vm_mm);
511 #else /* !CONFIG_MMU */
512 static inline void unmap_mapping_folio(struct folio *folio) { }
513 static inline void mlock_vma_page(struct page *page,
514 struct vm_area_struct *vma, bool compound) { }
515 static inline void munlock_vma_page(struct page *page,
516 struct vm_area_struct *vma, bool compound) { }
517 static inline void mlock_new_page(struct page *page) { }
518 static inline bool need_mlock_page_drain(int cpu) { return false; }
519 static inline void mlock_page_drain(int cpu) { }
520 static inline void vunmap_range_noflush(unsigned long start, unsigned long end)
523 #endif /* !CONFIG_MMU */
526 * Return the mem_map entry representing the 'offset' subpage within
527 * the maximally aligned gigantic page 'base'. Handle any discontiguity
528 * in the mem_map at MAX_ORDER_NR_PAGES boundaries.
530 static inline struct page *mem_map_offset(struct page *base, int offset)
532 if (unlikely(offset >= MAX_ORDER_NR_PAGES))
533 return nth_page(base, offset);
534 return base + offset;
538 * Iterator over all subpages within the maximally aligned gigantic
539 * page 'base'. Handle any discontiguity in the mem_map.
541 static inline struct page *mem_map_next(struct page *iter,
542 struct page *base, int offset)
544 if (unlikely((offset & (MAX_ORDER_NR_PAGES - 1)) == 0)) {
545 unsigned long pfn = page_to_pfn(base) + offset;
548 return pfn_to_page(pfn);
553 /* Memory initialisation debug and verification */
560 #ifdef CONFIG_DEBUG_MEMORY_INIT
562 extern int mminit_loglevel;
564 #define mminit_dprintk(level, prefix, fmt, arg...) \
566 if (level < mminit_loglevel) { \
567 if (level <= MMINIT_WARNING) \
568 pr_warn("mminit::" prefix " " fmt, ##arg); \
570 printk(KERN_DEBUG "mminit::" prefix " " fmt, ##arg); \
574 extern void mminit_verify_pageflags_layout(void);
575 extern void mminit_verify_zonelist(void);
578 static inline void mminit_dprintk(enum mminit_level level,
579 const char *prefix, const char *fmt, ...)
583 static inline void mminit_verify_pageflags_layout(void)
587 static inline void mminit_verify_zonelist(void)
590 #endif /* CONFIG_DEBUG_MEMORY_INIT */
592 /* mminit_validate_memmodel_limits is independent of CONFIG_DEBUG_MEMORY_INIT */
593 #if defined(CONFIG_SPARSEMEM)
594 extern void mminit_validate_memmodel_limits(unsigned long *start_pfn,
595 unsigned long *end_pfn);
597 static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn,
598 unsigned long *end_pfn)
601 #endif /* CONFIG_SPARSEMEM */
603 #define NODE_RECLAIM_NOSCAN -2
604 #define NODE_RECLAIM_FULL -1
605 #define NODE_RECLAIM_SOME 0
606 #define NODE_RECLAIM_SUCCESS 1
609 extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
610 extern int find_next_best_node(int node, nodemask_t *used_node_mask);
612 static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask,
615 return NODE_RECLAIM_NOSCAN;
617 static inline int find_next_best_node(int node, nodemask_t *used_node_mask)
623 extern int hwpoison_filter(struct page *p);
625 extern u32 hwpoison_filter_dev_major;
626 extern u32 hwpoison_filter_dev_minor;
627 extern u64 hwpoison_filter_flags_mask;
628 extern u64 hwpoison_filter_flags_value;
629 extern u64 hwpoison_filter_memcg;
630 extern u32 hwpoison_filter_enable;
632 extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long,
633 unsigned long, unsigned long,
634 unsigned long, unsigned long);
636 extern void set_pageblock_order(void);
637 unsigned int reclaim_clean_pages_from_list(struct zone *zone,
638 struct list_head *page_list);
639 /* The ALLOC_WMARK bits are used as an index to zone->watermark */
640 #define ALLOC_WMARK_MIN WMARK_MIN
641 #define ALLOC_WMARK_LOW WMARK_LOW
642 #define ALLOC_WMARK_HIGH WMARK_HIGH
643 #define ALLOC_NO_WATERMARKS 0x04 /* don't check watermarks at all */
645 /* Mask to get the watermark bits */
646 #define ALLOC_WMARK_MASK (ALLOC_NO_WATERMARKS-1)
649 * Only MMU archs have async oom victim reclaim - aka oom_reaper so we
650 * cannot assume a reduced access to memory reserves is sufficient for
654 #define ALLOC_OOM 0x08
656 #define ALLOC_OOM ALLOC_NO_WATERMARKS
659 #define ALLOC_HARDER 0x10 /* try to alloc harder */
660 #define ALLOC_HIGH 0x20 /* __GFP_HIGH set */
661 #define ALLOC_CPUSET 0x40 /* check for correct cpuset */
662 #define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
663 #ifdef CONFIG_ZONE_DMA32
664 #define ALLOC_NOFRAGMENT 0x100 /* avoid mixing pageblock types */
666 #define ALLOC_NOFRAGMENT 0x0
668 #define ALLOC_KSWAPD 0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
671 struct tlbflush_unmap_batch;
675 * only for MM internal work items which do not depend on
676 * any allocations or locks which might depend on allocations
678 extern struct workqueue_struct *mm_percpu_wq;
680 #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
681 void try_to_unmap_flush(void);
682 void try_to_unmap_flush_dirty(void);
683 void flush_tlb_batched_pending(struct mm_struct *mm);
685 static inline void try_to_unmap_flush(void)
688 static inline void try_to_unmap_flush_dirty(void)
691 static inline void flush_tlb_batched_pending(struct mm_struct *mm)
694 #endif /* CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH */
696 extern const struct trace_print_flags pageflag_names[];
697 extern const struct trace_print_flags vmaflag_names[];
698 extern const struct trace_print_flags gfpflag_names[];
700 static inline bool is_migrate_highatomic(enum migratetype migratetype)
702 return migratetype == MIGRATE_HIGHATOMIC;
705 static inline bool is_migrate_highatomic_page(struct page *page)
707 return get_pageblock_migratetype(page) == MIGRATE_HIGHATOMIC;
710 void setup_zone_pageset(struct zone *zone);
712 struct migration_target_control {
713 int nid; /* preferred node id */
722 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
723 pgprot_t prot, struct page **pages, unsigned int page_shift);
726 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
727 pgprot_t prot, struct page **pages, unsigned int page_shift)
733 void vunmap_range_noflush(unsigned long start, unsigned long end);
735 int numa_migrate_prep(struct page *page, struct vm_area_struct *vma,
736 unsigned long addr, int page_nid, int *flags);
738 void free_zone_device_page(struct page *page);
740 #endif /* __MM_INTERNAL_H */