|
17 | 17 | /*
|
18 | 18 | * Various page->flags bits:
|
19 | 19 | *
|
20 |
| - * PG_reserved is set for special pages, which can never be swapped out. Some |
21 |
| - * of them might not even exist... |
| 20 | + * PG_reserved is set for special pages. The "struct page" of such a page |
| 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 | 52 | * The PG_private bitflag is set on pagecache pages if they contain filesystem
|
24 | 53 | * specific data (which is normally at page->private). It can be used by
|
|
0 commit comments