Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c1596ef authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds
Browse files

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: default avatarJan 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4481374c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1331,7 +1331,7 @@ void __init e820_reserve_resources(void)
	struct resource *res;
	struct resource *res;
	u64 end;
	u64 end;


	res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
	res = alloc_bootmem(sizeof(struct resource) * e820.nr_map);
	e820_res = res;
	e820_res = res;
	for (i = 0; i < e820.nr_map; i++) {
	for (i = 0; i < e820.nr_map; i++) {
		end = e820.map[i].addr + e820.map[i].size - 1;
		end = e820.map[i].addr + e820.map[i].size - 1;
+2 −2
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
#ifdef CONFIG_X86_PAE
#ifdef CONFIG_X86_PAE
	if (!(pgd_val(*pgd) & _PAGE_PRESENT)) {
	if (!(pgd_val(*pgd) & _PAGE_PRESENT)) {
		if (after_bootmem)
		if (after_bootmem)
			pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
			pmd_table = (pmd_t *)alloc_bootmem_pages(PAGE_SIZE);
		else
		else
			pmd_table = (pmd_t *)alloc_low_page();
			pmd_table = (pmd_t *)alloc_low_page();
		paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
		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)
#endif
#endif
			if (!page_table)
			if (!page_table)
				page_table =
				page_table =
				(pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
				(pte_t *)alloc_bootmem_pages(PAGE_SIZE);
		} else
		} else
			page_table = (pte_t *)alloc_low_page();
			page_table = (pte_t *)alloc_low_page();


+1 −1
Original line number Original line Diff line number Diff line
@@ -164,7 +164,7 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type)
{
{
	struct firmware_map_entry *entry;
	struct firmware_map_entry *entry;


	entry = alloc_bootmem_low(sizeof(struct firmware_map_entry));
	entry = alloc_bootmem(sizeof(struct firmware_map_entry));
	if (WARN_ON(!entry))
	if (WARN_ON(!entry))
		return -ENOMEM;
		return -ENOMEM;


+1 −1
Original line number Original line Diff line number Diff line
@@ -619,7 +619,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
		BUG_ON(!region);
		BUG_ON(!region);
	} else
	} else
		/* This allocation cannot fail */
		/* This allocation cannot fail */
		region = alloc_bootmem_low(sizeof(struct nosave_region));
		region = alloc_bootmem(sizeof(struct nosave_region));
	region->start_pfn = start_pfn;
	region->start_pfn = start_pfn;
	region->end_pfn = end_pfn;
	region->end_pfn = end_pfn;
	list_add_tail(&region->list, &nosave_regions);
	list_add_tail(&region->list, &nosave_regions);