include/linux/page-flags-layout.h: cleanups
Tidy things up and delete comments stating the obvious with typos or making no sense. Link: https://lkml.kernel.org/r/20210303071609.797782-2-yuzhao@google.com Signed-off-by: Yu Zhao <yuzhao@google.com> Cc: Matthew Wilcox <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -21,16 +21,17 @@
|
|||||||
#elif MAX_NR_ZONES <= 8
|
#elif MAX_NR_ZONES <= 8
|
||||||
#define ZONES_SHIFT 3
|
#define ZONES_SHIFT 3
|
||||||
#else
|
#else
|
||||||
#error ZONES_SHIFT -- too many zones configured adjust calculation
|
#error ZONES_SHIFT "Too many zones configured"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ZONES_WIDTH ZONES_SHIFT
|
||||||
|
|
||||||
#ifdef CONFIG_SPARSEMEM
|
#ifdef CONFIG_SPARSEMEM
|
||||||
#include <asm/sparsemem.h>
|
#include <asm/sparsemem.h>
|
||||||
|
|
||||||
/* SECTION_SHIFT #bits space required to store a section # */
|
|
||||||
#define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS)
|
#define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS)
|
||||||
|
#else
|
||||||
#endif /* CONFIG_SPARSEMEM */
|
#define SECTIONS_SHIFT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef BUILD_VDSO32_64
|
#ifndef BUILD_VDSO32_64
|
||||||
/*
|
/*
|
||||||
@@ -54,17 +55,28 @@
|
|||||||
#define SECTIONS_WIDTH 0
|
#define SECTIONS_WIDTH 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZONES_WIDTH ZONES_SHIFT
|
#if ZONES_WIDTH + SECTIONS_WIDTH + NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
|
||||||
|
|
||||||
#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
|
|
||||||
#define NODES_WIDTH NODES_SHIFT
|
#define NODES_WIDTH NODES_SHIFT
|
||||||
#else
|
#elif defined(CONFIG_SPARSEMEM_VMEMMAP)
|
||||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
|
||||||
#error "Vmemmap: No space for nodes field in page flags"
|
#error "Vmemmap: No space for nodes field in page flags"
|
||||||
#endif
|
#else
|
||||||
#define NODES_WIDTH 0
|
#define NODES_WIDTH 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note that this #define MUST have a value so that it can be tested with
|
||||||
|
* the IS_ENABLED() macro.
|
||||||
|
*/
|
||||||
|
#if NODES_SHIFT != 0 && NODES_WIDTH == 0
|
||||||
|
#define NODE_NOT_IN_PAGE_FLAGS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
|
||||||
|
#define KASAN_TAG_WIDTH 8
|
||||||
|
#else
|
||||||
|
#define KASAN_TAG_WIDTH 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NUMA_BALANCING
|
#ifdef CONFIG_NUMA_BALANCING
|
||||||
#define LAST__PID_SHIFT 8
|
#define LAST__PID_SHIFT 8
|
||||||
#define LAST__PID_MASK ((1 << LAST__PID_SHIFT)-1)
|
#define LAST__PID_MASK ((1 << LAST__PID_SHIFT)-1)
|
||||||
@@ -77,37 +89,21 @@
|
|||||||
#define LAST_CPUPID_SHIFT 0
|
#define LAST_CPUPID_SHIFT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
|
#if ZONES_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + KASAN_TAG_WIDTH + LAST_CPUPID_SHIFT \
|
||||||
#define KASAN_TAG_WIDTH 8
|
|
||||||
#else
|
|
||||||
#define KASAN_TAG_WIDTH 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_WIDTH+LAST_CPUPID_SHIFT+KASAN_TAG_WIDTH \
|
|
||||||
<= BITS_PER_LONG - NR_PAGEFLAGS
|
<= BITS_PER_LONG - NR_PAGEFLAGS
|
||||||
#define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT
|
#define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT
|
||||||
#else
|
#else
|
||||||
#define LAST_CPUPID_WIDTH 0
|
#define LAST_CPUPID_WIDTH 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH+LAST_CPUPID_WIDTH+KASAN_TAG_WIDTH \
|
#if LAST_CPUPID_SHIFT != 0 && LAST_CPUPID_WIDTH == 0
|
||||||
|
#define LAST_CPUPID_NOT_IN_PAGE_FLAGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ZONES_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + KASAN_TAG_WIDTH + LAST_CPUPID_WIDTH \
|
||||||
> BITS_PER_LONG - NR_PAGEFLAGS
|
> BITS_PER_LONG - NR_PAGEFLAGS
|
||||||
#error "Not enough bits in page flags"
|
#error "Not enough bits in page flags"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* We are going to use the flags for the page to node mapping if its in
|
|
||||||
* there. This includes the case where there is no node, so it is implicit.
|
|
||||||
* Note that this #define MUST have a value so that it can be tested with
|
|
||||||
* the IS_ENABLED() macro.
|
|
||||||
*/
|
|
||||||
#if !(NODES_WIDTH > 0 || NODES_SHIFT == 0)
|
|
||||||
#define NODE_NOT_IN_PAGE_FLAGS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_NUMA_BALANCING) && LAST_CPUPID_WIDTH == 0
|
|
||||||
#define LAST_CPUPID_NOT_IN_PAGE_FLAGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* _LINUX_PAGE_FLAGS_LAYOUT */
|
#endif /* _LINUX_PAGE_FLAGS_LAYOUT */
|
||||||
|
|||||||
@@ -19,10 +19,6 @@
|
|||||||
#ifdef CONFIG_DEBUG_MEMORY_INIT
|
#ifdef CONFIG_DEBUG_MEMORY_INIT
|
||||||
int __meminitdata mminit_loglevel;
|
int __meminitdata mminit_loglevel;
|
||||||
|
|
||||||
#ifndef SECTIONS_SHIFT
|
|
||||||
#define SECTIONS_SHIFT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The zonelists are simply reported, validation is manual. */
|
/* The zonelists are simply reported, validation is manual. */
|
||||||
void __init mminit_verify_zonelist(void)
|
void __init mminit_verify_zonelist(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user