summaryrefslogtreecommitdiffstats
path: root/include/linux/page-flags.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r--include/linux/page-flags.h44
1 files changed, 38 insertions, 6 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 39b4494e29f1..9f8712a4b1a5 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -17,8 +17,37 @@
17/* 17/*
18 * Various page->flags bits: 18 * Various page->flags bits:
19 * 19 *
20 * PG_reserved is set for special pages, which can never be swapped out. Some 20 * PG_reserved is set for special pages. The "struct page" of such a page
21 * of them might not even exist... 21 * should in general not be touched (e.g. set dirty) except by its owner.
22 * Pages marked as PG_reserved include:
23 * - Pages part of the kernel image (including vDSO) and similar (e.g. BIOS,
24 * initrd, HW tables)
25 * - Pages reserved or allocated early during boot (before the page allocator
26 * was initialized). This includes (depending on the architecture) the
27 * initial vmemmap, initial page tables, crashkernel, elfcorehdr, and much
28 * much more. Once (if ever) freed, PG_reserved is cleared and they will
29 * be given to the page allocator.
30 * - Pages falling into physical memory gaps - not IORESOURCE_SYSRAM. Trying
31 * to read/write these pages might end badly. Don't touch!
32 * - The zero page(s)
33 * - Pages not added to the page allocator when onlining a section because
34 * they were excluded via the online_page_callback() or because they are
35 * PG_hwpoison.
36 * - Pages allocated in the context of kexec/kdump (loaded kernel image,
37 * control pages, vmcoreinfo)
38 * - MMIO/DMA pages. Some architectures don't allow to ioremap pages that are
39 * not marked PG_reserved (as they might be in use by somebody else who does
40 * not respect the caching strategy).
41 * - Pages part of an offline section (struct pages of offline sections should
42 * not be trusted as they will be initialized when first onlined).
43 * - MCA pages on ia64
44 * - Pages holding CPU notes for POWER Firmware Assisted Dump
45 * - Device memory (e.g. PMEM, DAX, HMM)
46 * Some PG_reserved pages will be excluded from the hibernation image.
47 * PG_reserved does in general not hinder anybody from dumping or swapping
48 * and is no longer required for remap_pfn_range(). ioremap might require it.
49 * Consequently, PG_reserved for a page mapped into user space can indicate
50 * the zero page, the vDSO, MMIO pages or device memory.
22 * 51 *
23 * The PG_private bitflag is set on pagecache pages if they contain filesystem 52 * The PG_private bitflag is set on pagecache pages if they contain filesystem
24 * specific data (which is normally at page->private). It can be used by 53 * specific data (which is normally at page->private). It can be used by
@@ -671,7 +700,7 @@ PAGEFLAG_FALSE(DoubleMap)
671/* Reserve 0x0000007f to catch underflows of page_mapcount */ 700/* Reserve 0x0000007f to catch underflows of page_mapcount */
672#define PAGE_MAPCOUNT_RESERVE -128 701#define PAGE_MAPCOUNT_RESERVE -128
673#define PG_buddy 0x00000080 702#define PG_buddy 0x00000080
674#define PG_balloon 0x00000100 703#define PG_offline 0x00000100
675#define PG_kmemcg 0x00000200 704#define PG_kmemcg 0x00000200
676#define PG_table 0x00000400 705#define PG_table 0x00000400
677 706
@@ -706,10 +735,13 @@ static __always_inline void __ClearPage##uname(struct page *page) \
706PAGE_TYPE_OPS(Buddy, buddy) 735PAGE_TYPE_OPS(Buddy, buddy)
707 736
708/* 737/*
709 * PageBalloon() is true for pages that are on the balloon page list 738 * PageOffline() indicates that the page is logically offline although the
710 * (see mm/balloon_compaction.c). 739 * containing section is online. (e.g. inflated in a balloon driver or
740 * not onlined when onlining the section).
741 * The content of these pages is effectively stale. Such pages should not
742 * be touched (read/write/dump/save) except by their owner.
711 */ 743 */
712PAGE_TYPE_OPS(Balloon, balloon) 744PAGE_TYPE_OPS(Offline, offline)
713 745
714/* 746/*
715 * If kmemcg is enabled, the buddy allocator will set PageKmemcg() on 747 * If kmemcg is enabled, the buddy allocator will set PageKmemcg() on