linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3.3-rc5] memblock: Fix size aligning of memblock_alloc_base_nid()
@ 2012-02-28 20:56 Tejun Heo
  2012-02-13  7:45 ` OF-related boot crash in 3.3.0-rc3-00188-g3ec1e88 Meelis Roos
  2012-02-28 22:16 ` [PATCH v3.3-rc5] " Sam Ravnborg
  0 siblings, 2 replies; 46+ messages in thread
From: Tejun Heo @ 2012-02-28 20:56 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin
  Cc: David S. Miller, linux-kernel, Meelis Roos, Grant Likely,
	Rob Herring, sparclinux, sam

memblock allocator aligns @size to @align to reduce the amount of
fragmentation.  7bd0b0f0da "memblock: Reimplement memblock allocation
using reverse free area iterator" broke it by incorrectly relocating
@size aligning to memblock_find_in_range_node().  As the aligned size
is not propagated back to memblock_alloc_base_nid(), the actually
reserved size isn't aligned.

While this increases memory use for memblock reserved array, this
shouldn't cause any critical failure; however, it seems that the size
aligning was hiding a use-beyond-allocation bug in sparc64 and losing
the aligning causes boot failure.

The underlying problem is currently being debugged but this is a
proper fix in itself, it's already pretty late in -rc cycle for boot
failures and reverting the change for debugging isn't difficult.
Restore the size aligning moving it to memblock_alloc_base_nid().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Meelis Roos <mroos@linux.ee>
Reported-by: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <alpine.SOC.1.00.1202130942030.1488@math.ut.ee>
---
 mm/memblock.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 77b5f22..99f2855 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -99,9 +99,6 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start,
 	phys_addr_t this_start, this_end, cand;
 	u64 i;
 
-	/* align @size to avoid excessive fragmentation on reserved array */
-	size = round_up(size, align);
-
 	/* pump up @end */
 	if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
 		end = memblock.current_limit;
@@ -731,6 +728,9 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
 {
 	phys_addr_t found;
 
+	/* align @size to avoid excessive fragmentation on reserved array */
+	size = round_up(size, align);
+
 	found = memblock_find_in_range_node(0, max_addr, size, align, nid);
 	if (found && !memblock_reserve(found, size))
 		return found;

^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2012-03-01 12:25 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-28 20:56 [PATCH v3.3-rc5] memblock: Fix size aligning of memblock_alloc_base_nid() Tejun Heo
2012-02-13  7:45 ` OF-related boot crash in 3.3.0-rc3-00188-g3ec1e88 Meelis Roos
2012-02-13  8:06   ` Grant Likely
2012-02-13  9:20     ` Meelis Roos
2012-02-13 21:46       ` Grant Likely
2012-02-14  0:58         ` David Miller
2012-02-14  2:30           ` Grant Likely
2012-02-14  2:41             ` Grant Likely
2012-02-16 21:08             ` mroos
2012-02-14  5:54           ` mroos
2012-02-16 19:53         ` Meelis Roos
2012-02-16 21:23           ` Sam Ravnborg
2012-02-20  9:11           ` Meelis Roos
2012-02-20 17:06             ` Tejun Heo
2012-02-20 20:04               ` Meelis Roos
2012-02-20 21:01                 ` Tejun Heo
2012-02-20 22:32               ` Meelis Roos
2012-02-21  1:05                 ` Tejun Heo
2012-02-22  0:36                   ` Meelis Roos
2012-02-22 17:48                     ` Tejun Heo
2012-02-22 18:25                       ` Meelis Roos
2012-02-23 18:55                         ` Tejun Heo
2012-02-23 23:31                           ` David Miller
2012-02-24  9:20                           ` Meelis Roos
2012-02-27 17:17                             ` Meelis Roos
2012-02-27 19:43                               ` Sam Ravnborg
2012-02-27 21:25                                 ` Meelis Roos
2012-02-27 21:30                                   ` David Miller
2012-02-28 21:10                                     ` David Miller
2012-02-28 21:36                                       ` Meelis Roos
2012-02-28 22:56                                         ` David Miller
2012-02-29  6:15                                           ` Meelis Roos
2012-02-29  6:27                                             ` David Miller
2012-02-22 20:44                       ` David Miller
2012-02-22 21:00                         ` Tejun Heo
2012-02-22 18:22                     ` Richard Mortimer
2012-02-22 20:26                       ` David Miller
2012-02-22 17:03                   ` Sam Ravnborg
2012-02-22 17:12                     ` Meelis Roos
2012-02-22 17:21                       ` Sam Ravnborg
2012-02-22 17:41                         ` Meelis Roos
2012-02-13  9:50     ` Meelis Roos
2012-02-13  9:51       ` Meelis Roos
2012-02-13 10:35       ` Meelis Roos
2012-03-01 12:24   ` [tip:core/urgent] memblock: Fix size aligning of memblock_alloc_base_nid() tip-bot for Tejun Heo
2012-02-28 22:16 ` [PATCH v3.3-rc5] " Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).