Skip to contentSkip to conversation

+ memblock-dont-align-size-silent-in-memblock_virt_alloc.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Jan 24, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + memblock-dont-align-size-silent-in-memblock_virt_alloc.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 24 Jan 2014 11:55:41 -0800

The patch titled
Subject: memblock: don't align size silent in memblock_virt_alloc()
has been added to the -mm tree. Its filename is
memblock-dont-align-size-silent-in-memblock_virt_alloc.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/memblock-dont-align-size-silent-in-memblock_virt_alloc.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/memblock-dont-align-size-silent-in-memblock_virt_alloc.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Yinghai Lu <[email protected]>
Subject: memblock: don't align size silent in memblock_virt_alloc()

In original __alloc_memory_core_early() for bootmem wrapper, we do not align size silently.

We should not do that, as later free with old size will leave some range not freed.

It's obvious that code is copied from memblock_base_nid(), and that code is wrong for the same reason.

Also remove that in memblock_alloc_base.

Cc Dave Hansen <[email protected]>
Cc Russell King <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

---

 mm/memblock.c |    6 ------
 1 file changed, 6 deletions(-)
mm/memblock.c renamed from mm/memblock.c~memblock-dont-align-size-silent-in-memblock_virt_alloc +0 -5
diff -puN mm/memblock.c~memblock-dont-align-size-silent-in-memblock_virt_alloc mm/memblock.c
@@ -984,9 +984,6 @@ static phys_addr_t __init memblock_alloc
 	if (!align)
 		align = SMP_CACHE_BYTES;
 
-	/* align @size to avoid excessive fragmentation on reserved array */
-	size = round_up(size, align);
-
 	found = memblock_find_in_range_node(size, align, 0, max_addr, nid);
 	if (found && !memblock_reserve(found, size))
 		return found;
@@ -1080,9 +1077,6 @@ static void * __init memblock_virt_alloc
 	if (!align)
 		align = SMP_CACHE_BYTES;
 
-	/* align @size to avoid excessive fragmentation on reserved array */
-	size = round_up(size, align);