Commit 79f40fab authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Linus Torvalds
Browse files

mm/memblock: drop WARN and use SMP_CACHE_BYTES as a default alignment

Don't produce warning and interpret 0 as "default align" equal to
SMP_CACHE_BYTES in case if caller of memblock_alloc_base_nid() doesn't
specify alignment for the block (align == 0).

This is done in preparation of introducing common memblock alloc interface
to make code behavior consistent.  More details are in below thread :


Signed-off-by: default avatarGrygorii Strashko <>
Signed-off-by: default avatarSantosh Shilimkar <>
Cc: Yinghai Lu <>
Cc: Tejun Heo <>
Cc: "Rafael J. Wysocki" <>
Cc: Arnd Bergmann <>
Cc: Christoph Lameter <>
Cc: Greg Kroah-Hartman <>
Cc: H. Peter Anvin <>
Cc: Johannes Weiner <>
Cc: KAMEZAWA Hiroyuki <>
Cc: Konrad Rzeszutek Wilk <>
Cc: Michal Hocko <>
Cc: Paul Walmsley <>
Cc: Pavel Machek <>
Cc: Russell King <>
Cc: Tony Lindgren <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 869a84e1
......@@ -969,8 +969,8 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
phys_addr_t found;
if (WARN_ON(!align))
align = __alignof__(long long);
if (!align)
/* align @size to avoid excessive fragmentation on reserved array */
size = round_up(size, align);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment