All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time-fix-2.patch removed from -mm tree
@ 2021-06-29  0:14 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-06-29  0:14 UTC (permalink / raw)
  To: 42.hyeyoo, cl, elver, iamjoonsoo.kim, mm-commits, naresh.kamboju,
	nathan, penberg, rientjes, vbabka


The patch titled
     Subject: mm, slub: fix support for clang 10
has been removed from the -mm tree.  Its filename was
     mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time-fix-2.patch

This patch was dropped because it was folded into mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time.patch

------------------------------------------------------
From: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Subject: mm, slub: fix support for clang 10

Previously in 'commit ff3daafe3fd3 ("mm, slub: change run-time assertion
in kmalloc_index() to compile-time")', changed kmalloc_index's run-time
assertion to compile-time assertion.

But clang 10 has a bug misevaluating __builtin_constant_p() as true,
making it unable to compile. This bug was fixed in clang 11.

To support clang 10, introduce a macro to do run-time assertion if clang
version is less than 11, even if the size is constant. Might revert this
commit later if we choose not to support clang 10.

Link: https://lkml.kernel.org/r/20210518181247.GA10062@hyeyoo
Fixes: ff3daafe3fd3 ("mm, slub: change run-time assertion in kmalloc_index() to compile-time")
Link: https://lore.kernel.org/r/CA+G9fYvYxqVhUTkertjZjcrUq8LWPnO7qC==Wum3gYCwWF9D6Q@mail.gmail.com/
Link: https://lkml.org/lkml/2021/5/11/872
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Marco Elver <elver@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/slab.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/slab.h~mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time-fix-2
+++ a/include/linux/slab.h
@@ -389,7 +389,7 @@ static __always_inline unsigned int __km
 	if (size <=  16 * 1024 * 1024) return 24;
 	if (size <=  32 * 1024 * 1024) return 25;
 
-	if (size_is_constant)
+	if ((IS_ENABLED(CONFIG_CC_IS_GCC) || CONFIG_CLANG_VERSION >= 110000) && size_is_constant)
 		BUILD_BUG_ON_MSG(1, "unexpected size in kmalloc_index()");
 	else
 		BUG();
_

Patches currently in -mm which might be from 42.hyeyoo@gmail.com are

mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time.patch
mm-fix-typos-and-grammar-error-in-comments.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-29  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  0:14 [folded-merged] mm-slub-change-run-time-assertion-in-kmalloc_index-to-compile-time-fix-2.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.