mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] ila-simplify-a-strange-allocation-pattern.patch removed from -mm tree
@ 2017-05-09 18:02 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-05-09 18:02 UTC (permalink / raw)
  To: davem, eric.dumazet, mhocko, mm-commits, tom, vbabka


The patch titled
     Subject: net/ipv6/ila/ila_xlat.c: simplify a strange allocation pattern
has been removed from the -mm tree.  Its filename was
     ila-simplify-a-strange-allocation-pattern.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Michal Hocko <mhocko@suse.com>
Subject: net/ipv6/ila/ila_xlat.c: simplify a strange allocation pattern

alloc_ila_locks seemed to c&p from alloc_bucket_locks allocation pattern
which is quite unusual.  The default allocation size is 320 *
sizeof(spinlock_t) which is sub page unless lockdep is enabled when the
performance benefit is really questionable and not worth the subtle code
IMHO.  Also note that the context when we call ila_init_net (modprobe or a
task creating a net namespace) has to be properly configured.

Let's just simplify the code and use kvmalloc helper which is a
transparent way to use kmalloc with vmalloc fallback.

Link: http://lkml.kernel.org/r/20170306103032.2540-5-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Tom Herbert <tom@herbertland.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 net/ipv6/ila/ila_xlat.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff -puN net/ipv6/ila/ila_xlat.c~ila-simplify-a-strange-allocation-pattern net/ipv6/ila/ila_xlat.c
--- a/net/ipv6/ila/ila_xlat.c~ila-simplify-a-strange-allocation-pattern
+++ a/net/ipv6/ila/ila_xlat.c
@@ -41,13 +41,7 @@ static int alloc_ila_locks(struct ila_ne
 	size = roundup_pow_of_two(nr_pcpus * LOCKS_PER_CPU);
 
 	if (sizeof(spinlock_t) != 0) {
-#ifdef CONFIG_NUMA
-		if (size * sizeof(spinlock_t) > PAGE_SIZE)
-			ilan->locks = vmalloc(size * sizeof(spinlock_t));
-		else
-#endif
-		ilan->locks = kmalloc_array(size, sizeof(spinlock_t),
-					    GFP_KERNEL);
+		ilan->locks = kvmalloc(size * sizeof(spinlock_t), GFP_KERNEL);
 		if (!ilan->locks)
 			return -ENOMEM;
 		for (i = 0; i < size; i++)
_

Patches currently in -mm which might be from mhocko@suse.com are



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

only message in thread, other threads:[~2017-05-09 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 18:02 [merged] ila-simplify-a-strange-allocation-pattern.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).