summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPratyush Yadav (Google) <pratyush@kernel.org>2026-09-22 06:13:14 +0200
committerMike Rapoport <rppt@kernel.org>2026-10-09 18:13:27 +0200
commit48edec475144a9acb9515d37475bda4752912727 (patch)
treeecbc1e3a05d83eb12219bf6fafae2ef42e2dbeb8 /include/linux
parent22626c347d250797fa76616feeb55ba9f6c0192c (diff)
downloadlinux-48edec475144a9acb9515d37475bda4752912727.tar.gz
linux-48edec475144a9acb9515d37475bda4752912727.zip
memblock: rename KHO_SCRATCH to KHO_NOPRSRV
The term "KHO scratch" is vague. It does not accurately describe what the memory is for. Generally, scratch is for things that don't contain anything useful. This is not true. For memblock, KHO_SCRATCH is the _only_ useful memory during a KHO boot. It is memory passed by the previous kernel that is guaranteed to have no preserved pages, and so is the only thing safe to allocate from early in boot. In addition, KHO now has the ability to discover other "scratch" areas. These aren't directly passed by the previous kernel. Instead, they are found by searching the KHO preserved memory map. Memblock does not care about the difference between the two. From memblock's perspective, both are memory areas with no preservations and so they are safe to allocate from before KHO fully initializes. Rename MEMBLOCK_KHO_SCRATCH to MEMBLOCK_KHO_NOPRSRV. This name clearly shows what the memory is for from memblock's perspective. Update memblock functions and comments that refer to scratch to use noprsrv. There are no functional changes apart from the flag name change in debugfs. Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org> Link: https://patch.msgid.link/20260922041321.233986-3-pratyush@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/memblock.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index db3b106c6335..aaa11a589843 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -46,11 +46,11 @@ extern unsigned long long max_possible_pfn;
* @MEMBLOCK_RSRV_KERN: memory region that is reserved for kernel use,
* either explictitly with memblock_reserve_kern() or via memblock
* allocation APIs. All memblock allocations set this flag.
- * @MEMBLOCK_KHO_SCRATCH: memory region that kexec can pass to the next
- * kernel in handover mode. During early boot, we do not know about all
- * memory reservations yet, so we get scratch memory from the previous
- * kernel that we know is good to use. It is the only memory that
- * allocations may happen from in this phase.
+ * @MEMBLOCK_KHO_NOPRSRV: memory region with no preservation from kexec
+ * handover. During early boot, we do not know about all memory preservations
+ * yet, so we get memory with no preservations from the previous kernel that we
+ * know is good to use. It is the only memory that allocations may happen from
+ * in this phase.
* @MEMBLOCK_RSRV_HUGETLB: memory is reserved for hugetlb pages
*/
enum memblock_flags {
@@ -61,7 +61,7 @@ enum memblock_flags {
MEMBLOCK_DRIVER_MANAGED = 0x8, /* always detected via a driver */
MEMBLOCK_RSRV_NOINIT = 0x10, /* don't initialize struct pages */
MEMBLOCK_RSRV_KERN = 0x20, /* memory reserved for kernel use */
- MEMBLOCK_KHO_SCRATCH = 0x40, /* scratch memory for kexec handover */
+ MEMBLOCK_KHO_NOPRSRV = 0x40, /* memory with no KHO preservations */
MEMBLOCK_RSRV_HUGETLB = 0x80, /* memory reserved for hugetlb pages */
};
@@ -158,8 +158,8 @@ int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
int memblock_clear_nomap(phys_addr_t base, phys_addr_t size);
int memblock_reserved_mark_noinit(phys_addr_t base, phys_addr_t size);
int memblock_reserved_mark_kern(phys_addr_t base, phys_addr_t size);
-int memblock_mark_kho_scratch(phys_addr_t base, phys_addr_t size);
-int memblock_clear_kho_scratch(phys_addr_t base, phys_addr_t size);
+int memblock_mark_kho_noprsrv(phys_addr_t base, phys_addr_t size);
+int memblock_clear_kho_noprsrv(phys_addr_t base, phys_addr_t size);
void memblock_free(void *ptr, size_t size);
void reset_all_zones_managed_pages(void);
@@ -301,9 +301,9 @@ static inline bool memblock_is_driver_managed(struct memblock_region *m)
return m->flags & MEMBLOCK_DRIVER_MANAGED;
}
-static inline bool memblock_is_kho_scratch(struct memblock_region *m)
+static inline bool memblock_is_kho_noprsrv(struct memblock_region *m)
{
- return m->flags & MEMBLOCK_KHO_SCRATCH;
+ return m->flags & MEMBLOCK_KHO_NOPRSRV;
}
int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
@@ -615,11 +615,11 @@ static inline void memtest_report_meminfo(struct seq_file *m) { }
#endif
#ifdef CONFIG_KEXEC_HANDOVER
-void memblock_set_kho_scratch_only(void);
-void memblock_clear_kho_scratch_only(void);
+void memblock_set_kho_noprsrv_only(void);
+void memblock_clear_kho_noprsrv_only(void);
#else
-static inline void memblock_set_kho_scratch_only(void) { }
-static inline void memblock_clear_kho_scratch_only(void) { }
+static inline void memblock_set_kho_noprsrv_only(void) { }
+static inline void memblock_clear_kho_noprsrv_only(void) { }
#endif
#endif /* _LINUX_MEMBLOCK_H */