Thread (8 messages) 8 messages, 6 authors, 2018-10-11

[PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

From: akpm@linux-foundation.org (Andrew Morton)
Date: 2018-10-05 22:19:38
Also in: linux-alpha, linux-m68k, linux-mips, linux-mm, linux-um, linuxppc-dev, lkml

On Fri,  5 Oct 2018 00:07:04 +0300 Mike Rapoport [off-list ref] wrote:
quoted hunk ↗ jump to hunk
When a memblock allocation APIs are called with align = 0, the alignment is
implicitly set to SMP_CACHE_BYTES.

Replace all such uses of memblock APIs with the 'align' parameter explicitly
set to SMP_CACHE_BYTES and stop implicit alignment assignment in the
memblock internal allocation functions.

For the case when memblock APIs are used via helper functions, e.g. like
iommu_arena_new_node() in Alpha, the helper functions were detected with
Coccinelle's help and then manually examined and updated where appropriate.

...
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1298,9 +1298,6 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
 {
 	phys_addr_t found;
 
-	if (!align)
-		align = SMP_CACHE_BYTES;
-
Can we add a WARN_ON_ONCE(!align) here?  To catch unconverted code
which sneaks in later on.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help