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.
5 * Written by David Howells (dhowells@redhat.com)
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);
69 void deactivate_file_folio(struct folio *folio);
71 void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
72 unsigned long floor, unsigned long ceiling);
73 void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte);
76 void unmap_page_range(struct mmu_gather *tlb,
77 struct vm_area_struct *vma,
78 unsigned long addr, unsigned long end,
79 struct zap_details *details);
81 void do_page_cache_ra(struct readahead_control *, unsigned long nr_to_read,
82 unsigned long lookahead_size);
83 void force_page_cache_ra(struct readahead_control *, unsigned long nr);
84 static inline void force_page_cache_readahead(struct address_space *mapping,
85 struct file *file, pgoff_t index, unsigned long nr_to_read)
87 DEFINE_READAHEAD(ractl, file, &file->f_ra, mapping, index);
88 force_page_cache_ra(&ractl, nr_to_read);
91 unsigned find_lock_entries(struct address_space *mapping, pgoff_t start,
92 pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
93 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
94 pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
95 void filemap_free_folio(struct address_space *mapping, struct folio *folio);
96 int truncate_inode_folio(struct address_space *mapping, struct folio *folio);
97 bool truncate_inode_partial_folio(struct folio *folio, loff_t start,
99 long invalidate_inode_page(struct page *page);
100 unsigned long invalidate_mapping_pagevec(struct address_space *mapping,
101 pgoff_t start, pgoff_t end, unsigned long *nr_pagevec);
104 * folio_evictable - Test whether a folio is evictable.
105 * @folio: The folio to test.
107 * Test whether @folio is evictable -- i.e., should be placed on
108 * active/inactive lists vs unevictable list.
110 * Reasons folio might not be evictable:
111 * 1. folio's mapping marked unevictable
112 * 2. One of the pages in the folio is part of an mlocked VMA
114 static inline bool folio_evictable(struct folio *folio)
118 /* Prevent address_space of inode and swap cache from being freed */
120 ret = !mapping_unevictable(folio_mapping(folio)) &&
121 !folio_test_mlocked(folio);
126 static inline bool page_evictable(struct page *page)
130 /* Prevent address_space of inode and swap cache from being freed */
132 ret = !mapping_unevictable(page_mapping(page)) && !PageMlocked(page);
138 * Turn a non-refcounted page (->_refcount == 0) into refcounted with
141 static inline void set_page_refcounted(struct page *page)
143 VM_BUG_ON_PAGE(PageTail(page), page);
144 VM_BUG_ON_PAGE(page_ref_count(page), page);
145 set_page_count(page, 1);
148 extern unsigned long highest_memmap_pfn;
151 * Maximum number of reclaim retries without progress before the OOM
152 * killer is consider the only way forward.
154 #define MAX_RECLAIM_RETRIES 16
159 int isolate_lru_page(struct page *page);
160 int folio_isolate_lru(struct folio *folio);
161 void putback_lru_page(struct page *page);
162 void folio_putback_lru(struct folio *folio);
163 extern void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason);
168 extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
175 * Structure for holding the mostly immutable allocation parameters passed
176 * between functions involved in allocations, including the alloc_pages*
177 * family of functions.
179 * nodemask, migratetype and highest_zoneidx are initialized only once in
180 * __alloc_pages() and then never change.
182 * zonelist, preferred_zone and highest_zoneidx are set first in
183 * __alloc_pages() for the fast path, and might be later changed
184 * in __alloc_pages_slowpath(). All other functions pass the whole structure
185 * by a const pointer.
187 struct alloc_context {
188 struct zonelist *zonelist;
189 nodemask_t *nodemask;
190 struct zoneref *preferred_zoneref;
194 * highest_zoneidx represents highest usable zone index of
195 * the allocation request. Due to the nature of the zone,
196 * memory on lower zone than the highest_zoneidx will be
197 * protected by lowmem_reserve[highest_zoneidx].
199 * highest_zoneidx is also used by reclaim/compaction to limit
200 * the target zone since higher zone than this index cannot be
201 * usable for this allocation request.
203 enum zone_type highest_zoneidx;
204 bool spread_dirty_pages;
208 * Locate the struct page for both the matching buddy in our
209 * pair (buddy1) and the combined O(n+1) page they form (page).
211 * 1) Any buddy B1 will have an order O twin B2 which satisfies
212 * the following equation:
214 * For example, if the starting buddy (buddy2) is #8 its order
216 * B2 = 8 ^ (1 << 1) = 8 ^ 2 = 10
218 * 2) Any buddy B will have an order O+1 parent P which
219 * satisfies the following equation:
222 * Assumption: *_mem_map is contiguous at least up to MAX_ORDER
224 static inline unsigned long
225 __find_buddy_pfn(unsigned long page_pfn, unsigned int order)
227 return page_pfn ^ (1 << order);
230 extern struct page *__pageblock_pfn_to_page(unsigned long start_pfn,
231 unsigned long end_pfn, struct zone *zone);
233 static inline struct page *pageblock_pfn_to_page(unsigned long start_pfn,
234 unsigned long end_pfn, struct zone *zone)
236 if (zone->contiguous)
237 return pfn_to_page(start_pfn);
239 return __pageblock_pfn_to_page(start_pfn, end_pfn, zone);
242 extern int __isolate_free_page(struct page *page, unsigned int order);
243 extern void __putback_isolated_page(struct page *page, unsigned int order,
245 extern void memblock_free_pages(struct page *page, unsigned long pfn,
247 extern void __free_pages_core(struct page *page, unsigned int order);
248 extern void prep_compound_page(struct page *page, unsigned int order);
249 extern void post_alloc_hook(struct page *page, unsigned int order,
251 extern int user_min_free_kbytes;
253 extern void free_unref_page(struct page *page, unsigned int order);
254 extern void free_unref_page_list(struct list_head *list);
256 extern void zone_pcp_update(struct zone *zone, int cpu_online);
257 extern void zone_pcp_reset(struct zone *zone);
258 extern void zone_pcp_disable(struct zone *zone);
259 extern void zone_pcp_enable(struct zone *zone);
261 extern void *memmap_alloc(phys_addr_t size, phys_addr_t align,
262 phys_addr_t min_addr,
263 int nid, bool exact_nid);
265 #if defined CONFIG_COMPACTION || defined CONFIG_CMA
271 * compact_control is used to track pages being migrated and the free pages
272 * they are being migrated to during memory compaction. The free_pfn starts
273 * at the end of a zone and migrate_pfn begins at the start. Movable pages
274 * are moved to the end of a zone during a compaction run and the run
275 * completes when free_pfn <= migrate_pfn
277 struct compact_control {
278 struct list_head freepages; /* List of free pages to migrate to */
279 struct list_head migratepages; /* List of pages being migrated */
280 unsigned int nr_freepages; /* Number of isolated free pages */
281 unsigned int nr_migratepages; /* Number of pages to migrate */
282 unsigned long free_pfn; /* isolate_freepages search base */
284 * Acts as an in/out parameter to page isolation for migration.
285 * isolate_migratepages uses it as a search base.
286 * isolate_migratepages_block will update the value to the next pfn
287 * after the last isolated one.
289 unsigned long migrate_pfn;
290 unsigned long fast_start_pfn; /* a pfn to start linear scan from */
292 unsigned long total_migrate_scanned;
293 unsigned long total_free_scanned;
294 unsigned short fast_search_fail;/* failures to use free list searches */
295 short search_order; /* order to start a fast search at */
296 const gfp_t gfp_mask; /* gfp mask of a direct compactor */
297 int order; /* order a direct compactor needs */
298 int migratetype; /* migratetype of direct compactor */
299 const unsigned int alloc_flags; /* alloc flags of a direct compactor */
300 const int highest_zoneidx; /* zone index of a direct compactor */
301 enum migrate_mode mode; /* Async or sync migration mode */
302 bool ignore_skip_hint; /* Scan blocks even if marked skip */
303 bool no_set_skip_hint; /* Don't mark blocks for skipping */
304 bool ignore_block_suitable; /* Scan blocks considered unsuitable */
305 bool direct_compaction; /* False from kcompactd or /proc/... */
306 bool proactive_compaction; /* kcompactd proactive compaction */
307 bool whole_zone; /* Whole zone should/has been scanned */
308 bool contended; /* Signal lock or sched contention */
309 bool rescan; /* Rescanning the same pageblock */
310 bool alloc_contig; /* alloc_contig_range allocation */
314 * Used in direct compaction when a page should be taken from the freelists
315 * immediately when one is created during the free path.
317 struct capture_control {
318 struct compact_control *cc;
323 isolate_freepages_range(struct compact_control *cc,
324 unsigned long start_pfn, unsigned long end_pfn);
326 isolate_migratepages_range(struct compact_control *cc,
327 unsigned long low_pfn, unsigned long end_pfn);
329 int find_suitable_fallback(struct free_area *area, unsigned int order,
330 int migratetype, bool only_stealable, bool *can_steal);
333 * This function returns the order of a free page in the buddy system. In
334 * general, page_zone(page)->lock must be held by the caller to prevent the
335 * page from being allocated in parallel and returning garbage as the order.
336 * If a caller does not hold page_zone(page)->lock, it must guarantee that the
337 * page cannot be allocated or merged in parallel. Alternatively, it must
338 * handle invalid values gracefully, and use buddy_order_unsafe() below.
340 static inline unsigned int buddy_order(struct page *page)
342 /* PageBuddy() must be checked by the caller */
343 return page_private(page);
347 * Like buddy_order(), but for callers who cannot afford to hold the zone lock.
348 * PageBuddy() should be checked first by the caller to minimize race window,
349 * and invalid values must be handled gracefully.
351 * READ_ONCE is used so that if the caller assigns the result into a local
352 * variable and e.g. tests it for valid range before using, the compiler cannot
353 * decide to remove the variable and inline the page_private(page) multiple
354 * times, potentially observing different values in the tests and the actual
357 #define buddy_order_unsafe(page) READ_ONCE(page_private(page))
360 * These three helpers classifies VMAs for virtual memory accounting.
364 * Executable code area - executable, not writable, not stack
366 static inline bool is_exec_mapping(vm_flags_t flags)
368 return (flags & (VM_EXEC | VM_WRITE | VM_STACK)) == VM_EXEC;
372 * Stack area - automatically grows in one direction
374 * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous:
375 * do_mmap() forbids all other combinations.
377 static inline bool is_stack_mapping(vm_flags_t flags)
379 return (flags & VM_STACK) == VM_STACK;
383 * Data area - private, writable, not stack
385 static inline bool is_data_mapping(vm_flags_t flags)
387 return (flags & (VM_WRITE | VM_SHARED | VM_STACK)) == VM_WRITE;
391 void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
392 struct vm_area_struct *prev);
393 void __vma_unlink_list(struct mm_struct *mm, struct vm_area_struct *vma);
396 void unmap_mapping_folio(struct folio *folio);
397 extern long populate_vma_page_range(struct vm_area_struct *vma,
398 unsigned long start, unsigned long end, int *locked);
399 extern long faultin_vma_page_range(struct vm_area_struct *vma,
400 unsigned long start, unsigned long end,
401 bool write, int *locked);
402 extern int mlock_future_check(struct mm_struct *mm, unsigned long flags,
405 * mlock_vma_page() and munlock_vma_page():
406 * should be called with vma's mmap_lock held for read or write,
407 * under page table lock for the pte/pmd being added or removed.
409 * mlock is usually called at the end of page_add_*_rmap(),
410 * munlock at the end of page_remove_rmap(); but new anon
411 * pages are managed by lru_cache_add_inactive_or_unevictable()
412 * calling mlock_new_page().
414 * @compound is used to include pmd mappings of THPs, but filter out
415 * pte mappings of THPs, which cannot be consistently counted: a pte
416 * mapping of the THP head cannot be distinguished by the page alone.
418 void mlock_page(struct page *page);
419 static inline void mlock_vma_page(struct page *page,
420 struct vm_area_struct *vma, bool compound)
423 * The VM_SPECIAL check here serves two purposes.
424 * 1) VM_IO check prevents migration from double-counting during mlock.
425 * 2) Although mmap_region() and mlock_fixup() take care that VM_LOCKED
426 * is never left set on a VM_SPECIAL vma, there is an interval while
427 * file->f_op->mmap() is using vm_insert_page(s), when VM_LOCKED may
428 * still be set while VM_SPECIAL bits are added: so ignore it then.
430 if (unlikely((vma->vm_flags & (VM_LOCKED|VM_SPECIAL)) == VM_LOCKED) &&
431 (compound || !PageTransCompound(page)))
434 void munlock_page(struct page *page);
435 static inline void munlock_vma_page(struct page *page,
436 struct vm_area_struct *vma, bool compound)
438 if (unlikely(vma->vm_flags & VM_LOCKED) &&
439 (compound || !PageTransCompound(page)))
442 void mlock_new_page(struct page *page);
443 bool need_mlock_page_drain(int cpu);
444 void mlock_page_drain(int cpu);
446 extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma);
449 * At what user virtual address is page expected in vma?
450 * Returns -EFAULT if all of the page is outside the range of vma.
451 * If page is a compound head, the entire compound page is considered.
453 static inline unsigned long
454 vma_address(struct page *page, struct vm_area_struct *vma)
457 unsigned long address;
459 VM_BUG_ON_PAGE(PageKsm(page), page); /* KSM page->index unusable */
460 pgoff = page_to_pgoff(page);
461 if (pgoff >= vma->vm_pgoff) {
462 address = vma->vm_start +
463 ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
464 /* Check for address beyond vma (or wrapped through 0?) */
465 if (address < vma->vm_start || address >= vma->vm_end)
467 } else if (PageHead(page) &&
468 pgoff + compound_nr(page) - 1 >= vma->vm_pgoff) {
469 /* Test above avoids possibility of wrap to 0 on 32-bit */
470 address = vma->vm_start;
478 * Then at what user virtual address will none of the page be found in vma?
479 * Assumes that vma_address() already returned a good starting address.
480 * If page is a compound head, the entire compound page is considered.
482 static inline unsigned long
483 vma_address_end(struct page *page, struct vm_area_struct *vma)
486 unsigned long address;
488 VM_BUG_ON_PAGE(PageKsm(page), page); /* KSM page->index unusable */
489 pgoff = page_to_pgoff(page) + compound_nr(page);
490 address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
491 /* Check for address beyond vma (or wrapped through 0?) */
492 if (address < vma->vm_start || address > vma->vm_end)
493 address = vma->vm_end;
497 static inline struct file *maybe_unlock_mmap_for_io(struct vm_fault *vmf,
500 int flags = vmf->flags;
506 * FAULT_FLAG_RETRY_NOWAIT means we don't want to wait on page locks or
507 * anything, so we only pin the file and drop the mmap_lock if only
508 * FAULT_FLAG_ALLOW_RETRY is set, while this is the first attempt.
510 if (fault_flag_allow_retry_first(flags) &&
511 !(flags & FAULT_FLAG_RETRY_NOWAIT)) {
512 fpin = get_file(vmf->vma->vm_file);
513 mmap_read_unlock(vmf->vma->vm_mm);
517 #else /* !CONFIG_MMU */
518 static inline void unmap_mapping_folio(struct folio *folio) { }
519 static inline void mlock_vma_page(struct page *page,
520 struct vm_area_struct *vma, bool compound) { }
521 static inline void munlock_vma_page(struct page *page,
522 struct vm_area_struct *vma, bool compound) { }
523 static inline void mlock_new_page(struct page *page) { }
524 static inline bool need_mlock_page_drain(int cpu) { return false; }
525 static inline void mlock_page_drain(int cpu) { }
526 static inline void vunmap_range_noflush(unsigned long start, unsigned long end)
529 #endif /* !CONFIG_MMU */
532 * Return the mem_map entry representing the 'offset' subpage within
533 * the maximally aligned gigantic page 'base'. Handle any discontiguity
534 * in the mem_map at MAX_ORDER_NR_PAGES boundaries.
536 static inline struct page *mem_map_offset(struct page *base, int offset)
538 if (unlikely(offset >= MAX_ORDER_NR_PAGES))
539 return nth_page(base, offset);
540 return base + offset;
544 * Iterator over all subpages within the maximally aligned gigantic
545 * page 'base'. Handle any discontiguity in the mem_map.
547 static inline struct page *mem_map_next(struct page *iter,
548 struct page *base, int offset)
550 if (unlikely((offset & (MAX_ORDER_NR_PAGES - 1)) == 0)) {
551 unsigned long pfn = page_to_pfn(base) + offset;
554 return pfn_to_page(pfn);
559 /* Memory initialisation debug and verification */
566 #ifdef CONFIG_DEBUG_MEMORY_INIT
568 extern int mminit_loglevel;
570 #define mminit_dprintk(level, prefix, fmt, arg...) \
572 if (level < mminit_loglevel) { \
573 if (level <= MMINIT_WARNING) \
574 pr_warn("mminit::" prefix " " fmt, ##arg); \
576 printk(KERN_DEBUG "mminit::" prefix " " fmt, ##arg); \
580 extern void mminit_verify_pageflags_layout(void);
581 extern void mminit_verify_zonelist(void);
584 static inline void mminit_dprintk(enum mminit_level level,
585 const char *prefix, const char *fmt, ...)
589 static inline void mminit_verify_pageflags_layout(void)
593 static inline void mminit_verify_zonelist(void)
596 #endif /* CONFIG_DEBUG_MEMORY_INIT */
598 /* mminit_validate_memmodel_limits is independent of CONFIG_DEBUG_MEMORY_INIT */
599 #if defined(CONFIG_SPARSEMEM)
600 extern void mminit_validate_memmodel_limits(unsigned long *start_pfn,
601 unsigned long *end_pfn);
603 static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn,
604 unsigned long *end_pfn)
607 #endif /* CONFIG_SPARSEMEM */
609 #define NODE_RECLAIM_NOSCAN -2
610 #define NODE_RECLAIM_FULL -1
611 #define NODE_RECLAIM_SOME 0
612 #define NODE_RECLAIM_SUCCESS 1
615 extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
616 extern int find_next_best_node(int node, nodemask_t *used_node_mask);
618 static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask,
621 return NODE_RECLAIM_NOSCAN;
623 static inline int find_next_best_node(int node, nodemask_t *used_node_mask)
629 extern int hwpoison_filter(struct page *p);
631 extern u32 hwpoison_filter_dev_major;
632 extern u32 hwpoison_filter_dev_minor;
633 extern u64 hwpoison_filter_flags_mask;
634 extern u64 hwpoison_filter_flags_value;
635 extern u64 hwpoison_filter_memcg;
636 extern u32 hwpoison_filter_enable;
638 extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long,
639 unsigned long, unsigned long,
640 unsigned long, unsigned long);
642 extern void set_pageblock_order(void);
643 unsigned int reclaim_clean_pages_from_list(struct zone *zone,
644 struct list_head *page_list);
645 /* The ALLOC_WMARK bits are used as an index to zone->watermark */
646 #define ALLOC_WMARK_MIN WMARK_MIN
647 #define ALLOC_WMARK_LOW WMARK_LOW
648 #define ALLOC_WMARK_HIGH WMARK_HIGH
649 #define ALLOC_NO_WATERMARKS 0x04 /* don't check watermarks at all */
651 /* Mask to get the watermark bits */
652 #define ALLOC_WMARK_MASK (ALLOC_NO_WATERMARKS-1)
655 * Only MMU archs have async oom victim reclaim - aka oom_reaper so we
656 * cannot assume a reduced access to memory reserves is sufficient for
660 #define ALLOC_OOM 0x08
662 #define ALLOC_OOM ALLOC_NO_WATERMARKS
665 #define ALLOC_HARDER 0x10 /* try to alloc harder */
666 #define ALLOC_HIGH 0x20 /* __GFP_HIGH set */
667 #define ALLOC_CPUSET 0x40 /* check for correct cpuset */
668 #define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
669 #ifdef CONFIG_ZONE_DMA32
670 #define ALLOC_NOFRAGMENT 0x100 /* avoid mixing pageblock types */
672 #define ALLOC_NOFRAGMENT 0x0
674 #define ALLOC_KSWAPD 0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
677 struct tlbflush_unmap_batch;
681 * only for MM internal work items which do not depend on
682 * any allocations or locks which might depend on allocations
684 extern struct workqueue_struct *mm_percpu_wq;
686 #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
687 void try_to_unmap_flush(void);
688 void try_to_unmap_flush_dirty(void);
689 void flush_tlb_batched_pending(struct mm_struct *mm);
691 static inline void try_to_unmap_flush(void)
694 static inline void try_to_unmap_flush_dirty(void)
697 static inline void flush_tlb_batched_pending(struct mm_struct *mm)
700 #endif /* CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH */
702 extern const struct trace_print_flags pageflag_names[];
703 extern const struct trace_print_flags vmaflag_names[];
704 extern const struct trace_print_flags gfpflag_names[];
706 static inline bool is_migrate_highatomic(enum migratetype migratetype)
708 return migratetype == MIGRATE_HIGHATOMIC;
711 static inline bool is_migrate_highatomic_page(struct page *page)
713 return get_pageblock_migratetype(page) == MIGRATE_HIGHATOMIC;
716 void setup_zone_pageset(struct zone *zone);
718 struct migration_target_control {
719 int nid; /* preferred node id */
728 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
729 pgprot_t prot, struct page **pages, unsigned int page_shift);
732 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
733 pgprot_t prot, struct page **pages, unsigned int page_shift)
739 void vunmap_range_noflush(unsigned long start, unsigned long end);
741 int numa_migrate_prep(struct page *page, struct vm_area_struct *vma,
742 unsigned long addr, int page_nid, int *flags);
744 void free_zone_device_page(struct page *page);
749 struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
751 #endif /* __MM_INTERNAL_H */