diff mbox

[v3,05/23] mm/memblock: drop WARN and use SMP_CACHE_BYTES as a default alignment

Message ID 1386625856-12942-6-git-send-email-santosh.shilimkar@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Santosh Shilimkar Dec. 9, 2013, 9:50 p.m. UTC
From: Grygorii Strashko <grygorii.strashko@ti.com>

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 :
	https://lkml.org/lkml/2013/10/13/117.

Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 mm/memblock.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tejun Heo Dec. 13, 2013, 9:21 p.m. UTC | #1
On Mon, Dec 09, 2013 at 04:50:38PM -0500, Santosh Shilimkar wrote:
> From: Grygorii Strashko <grygorii.strashko@ti.com>
> 
> 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 :
> 	https://lkml.org/lkml/2013/10/13/117.
> 
> Cc: Yinghai Lu <yinghai@kernel.org>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Reviewed-by: Tejun Heo <tj@kernel.org>

Thanks.
diff mbox

Patch

diff --git a/mm/memblock.c b/mm/memblock.c
index 39855d4..784958d 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -883,8 +883,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 = SMP_CACHE_BYTES;
 
 	/* align @size to avoid excessive fragmentation on reserved array */
 	size = round_up(size, align);