Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memblock: Kill sentinel entries at the end of static region arrays

memblock no longer depends on having one more entry at the end during
addition making the sentinel entries at the end of region arrays not
too useful. Remove the sentinels. This eases further updates.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>

Tejun Heo c5a1cb28 4ff7b82f

+2 -18
-6
include/linux/poison.h
··· 40 40 #define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */ 41 41 #define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */ 42 42 43 - #ifdef CONFIG_PHYS_ADDR_T_64BIT 44 - #define MEMBLOCK_INACTIVE 0x3a84fb0144c9e71bULL 45 - #else 46 - #define MEMBLOCK_INACTIVE 0x44c9e71bUL 47 - #endif 48 - 49 43 #define SLUB_RED_INACTIVE 0xbb 50 44 #define SLUB_RED_ACTIVE 0xcc 51 45
+2 -12
mm/memblock.c
··· 24 24 25 25 int memblock_debug __initdata_memblock; 26 26 int memblock_can_resize __initdata_memblock; 27 - static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS + 1] __initdata_memblock; 28 - static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS + 1] __initdata_memblock; 27 + static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 28 + static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 29 29 30 30 /* inline so we don't get a warning when pr_debug is compiled out */ 31 31 static inline const char *memblock_type_name(struct memblock_type *type) ··· 911 911 { 912 912 int i; 913 913 914 - /* Check marker in the unused last array entry */ 915 - WARN_ON(memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS].base 916 - != MEMBLOCK_INACTIVE); 917 - WARN_ON(memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS].base 918 - != MEMBLOCK_INACTIVE); 919 - 920 914 memblock.memory_size = 0; 921 915 922 916 for (i = 0; i < memblock.memory.cnt; i++) ··· 933 939 memblock.memory.max = INIT_MEMBLOCK_REGIONS; 934 940 memblock.reserved.regions = memblock_reserved_init_regions; 935 941 memblock.reserved.max = INIT_MEMBLOCK_REGIONS; 936 - 937 - /* Write a marker in the unused last array entry */ 938 - memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = MEMBLOCK_INACTIVE; 939 - memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = MEMBLOCK_INACTIVE; 940 942 941 943 /* Create a dummy zero size MEMBLOCK which will get coalesced away later. 942 944 * This simplifies the memblock_add() code below...