Skip to content

Commit 3c1596e

Browse files
Jan Beulichtorvalds
authored andcommitted
mm: don't use alloc_bootmem_low() where not strictly needed
Since alloc_bootmem() will never return inaccessible (via virtual addressing) memory anyway, using the ..._low() variant only makes sense when the physical address range of the allocated memory must fulfill further constraints, espacially since on 64-bits (or more generally in all cases where the pools the two variants allocate from are than the full available range. Probably the use in alloc_tce_table() could also be eliminated (based on code inspection of pci-calgary_64.c), but that seems too risky given I know nothing about that hardware and have no way to test it. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4481374 commit 3c1596e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎arch/x86/kernel/e820.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ void __init e820_reserve_resources(void)
13311331
struct resource *res;
13321332
u64 end;
13331333

1334-
res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
1334+
res = alloc_bootmem(sizeof(struct resource) * e820.nr_map);
13351335
e820_res = res;
13361336
for (i = 0; i < e820.nr_map; i++) {
13371337
end = e820.map[i].addr + e820.map[i].size - 1;

‎arch/x86/mm/init_32.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
8484
#ifdef CONFIG_X86_PAE
8585
if (!(pgd_val(*pgd) & _PAGE_PRESENT)) {
8686
if (after_bootmem)
87-
pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
87+
pmd_table = (pmd_t *)alloc_bootmem_pages(PAGE_SIZE);
8888
else
8989
pmd_table = (pmd_t *)alloc_low_page();
9090
paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
@@ -116,7 +116,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
116116
#endif
117117
if (!page_table)
118118
page_table =
119-
(pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
119+
(pte_t *)alloc_bootmem_pages(PAGE_SIZE);
120120
} else
121121
page_table = (pte_t *)alloc_low_page();
122122

‎drivers/firmware/memmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type)
164164
{
165165
struct firmware_map_entry *entry;
166166

167-
entry = alloc_bootmem_low(sizeof(struct firmware_map_entry));
167+
entry = alloc_bootmem(sizeof(struct firmware_map_entry));
168168
if (WARN_ON(!entry))
169169
return -ENOMEM;
170170

‎kernel/power/snapshot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
619619
BUG_ON(!region);
620620
} else
621621
/* This allocation cannot fail */
622-
region = alloc_bootmem_low(sizeof(struct nosave_region));
622+
region = alloc_bootmem(sizeof(struct nosave_region));
623623
region->start_pfn = start_pfn;
624624
region->end_pfn = end_pfn;
625625
list_add_tail(&region->list, &nosave_regions);

0 commit comments

Comments
 (0)