* [merged] mm-faster-kmalloc_array-kcalloc.patch removed from -mm tree
@ 2016-07-27 18:59 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2016-07-27 18:59 UTC (permalink / raw)
To: adobriyan, cl, iamjoonsoo.kim, penberg, rientjes, mm-commits
The patch titled
Subject: mm: faster kmalloc_array(), kcalloc()
has been removed from the -mm tree. Its filename was
mm-faster-kmalloc_array-kcalloc.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
Subject: mm: faster kmalloc_array(), kcalloc()
When both arguments to kmalloc_array() or kcalloc() are known at compile
time then their product is known at compile time but search for kmalloc
cache happens at runtime not at compile time.
Link: http://lkml.kernel.org/r/20160627213454.GA2440@p183.telecom.by
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/slab.h | 2 ++
1 file changed, 2 insertions(+)
diff -puN include/linux/slab.h~mm-faster-kmalloc_array-kcalloc include/linux/slab.h
--- a/include/linux/slab.h~mm-faster-kmalloc_array-kcalloc
+++ a/include/linux/slab.h
@@ -565,6 +565,8 @@ static inline void *kmalloc_array(size_t
{
if (size != 0 && n > SIZE_MAX / size)
return NULL;
+ if (__builtin_constant_p(n) && __builtin_constant_p(size))
+ return kmalloc(n * size, flags);
return __kmalloc(n * size, flags);
}
_
Patches currently in -mm which might be from adobriyan@gmail.com are
kbuild-simpler-generation-of-assembly-constants.patch
uapi-move-forward-declarations-of-internal-structures.patch
ban-config_localversion_auto-with-allmodconfig.patch
ipc-delete-nr_ipc_ns.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-27 18:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27 18:59 [merged] mm-faster-kmalloc_array-kcalloc.patch removed from -mm tree akpm
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).