File Index
Files and directories
Sign in
FILE

page-isolation.h

File preview with syntax highlighting.

linux-6.19.14/include/linux/page-isolation.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __LINUX_PAGEISOLATION_H
 3#define __LINUX_PAGEISOLATION_H
 4
 5#ifdef CONFIG_MEMORY_ISOLATION
 6static inline bool is_migrate_isolate_page(struct page *page)
 7{
 8	return get_pageblock_migratetype(page) == MIGRATE_ISOLATE;
 9}
10static inline bool is_migrate_isolate(int migratetype)
11{
12	return migratetype == MIGRATE_ISOLATE;
13}
14#define get_pageblock_isolate(page) \
15	get_pfnblock_bit(page, page_to_pfn(page), PB_migrate_isolate)
16#define clear_pageblock_isolate(page) \
17	clear_pfnblock_bit(page, page_to_pfn(page), PB_migrate_isolate)
18#define set_pageblock_isolate(page) \
19	set_pfnblock_bit(page, page_to_pfn(page), PB_migrate_isolate)
20#else
21static inline bool is_migrate_isolate_page(struct page *page)
22{
23	return false;
24}
25static inline bool is_migrate_isolate(int migratetype)
26{
27	return false;
28}
29static inline bool get_pageblock_isolate(struct page *page)
30{
31	return false;
32}
33static inline void clear_pageblock_isolate(struct page *page)
34{
35}
36static inline void set_pageblock_isolate(struct page *page)
37{
38}
39#endif
40
41/*
42 * Pageblock isolation modes:
43 * PB_ISOLATE_MODE_MEM_OFFLINE - isolate to offline (!allocate) memory
44 *				 e.g., skip over PageHWPoison() pages and
45 *				 PageOffline() pages. Unmovable pages will be
46 *				 reported in this mode.
47 * PB_ISOLATE_MODE_CMA_ALLOC   - isolate for CMA allocations
48 * PB_ISOLATE_MODE_OTHER       - isolate for other purposes
49 */
50enum pb_isolate_mode {
51	PB_ISOLATE_MODE_MEM_OFFLINE,
52	PB_ISOLATE_MODE_CMA_ALLOC,
53	PB_ISOLATE_MODE_OTHER,
54};
55
56void __meminit init_pageblock_migratetype(struct page *page,
57					  enum migratetype migratetype,
58					  bool isolate);
59
60bool pageblock_isolate_and_move_free_pages(struct zone *zone, struct page *page);
61bool pageblock_unisolate_and_move_free_pages(struct zone *zone, struct page *page);
62
63int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
64			     enum pb_isolate_mode mode);
65
66void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn);
67
68int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
69			enum pb_isolate_mode mode);
70#endif
~/ Read-only file preview.