LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] slab_common: remove test if cache name is accessible
@ 2018-03-23 15:34 Mikulas Patocka
  2018-03-23 15:52 ` Christopher Lameter
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2018-03-23 15:34 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: linux-mm, linux-kernel

Since the commit db265eca7700 ("mm/sl[aou]b: Move duping of slab name to
slab_common.c"), the kernel always duplicates the slab cache name when
creating a slab cache, so the test if the slab name is accessible is
useless.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 mm/slab_common.c |   19 -------------------
 1 file changed, 19 deletions(-)

Index: linux-2.6/mm/slab_common.c
===================================================================
--- linux-2.6.orig/mm/slab_common.c	2018-03-21 12:43:19.418416000 +0100
+++ linux-2.6/mm/slab_common.c	2018-03-21 12:51:32.619999000 +0100
@@ -83,31 +83,12 @@ EXPORT_SYMBOL(kmem_cache_size);
 #ifdef CONFIG_DEBUG_VM
 static int kmem_cache_sanity_check(const char *name, size_t size)
 {
-	struct kmem_cache *s = NULL;
-
 	if (!name || in_interrupt() || size < sizeof(void *) ||
 		size > KMALLOC_MAX_SIZE) {
 		pr_err("kmem_cache_create(%s) integrity check failed\n", name);
 		return -EINVAL;
 	}
 
-	list_for_each_entry(s, &slab_caches, list) {
-		char tmp;
-		int res;
-
-		/*
-		 * This happens when the module gets unloaded and doesn't
-		 * destroy its slab cache and no-one else reuses the vmalloc
-		 * area of the module.  Print a warning.
-		 */
-		res = probe_kernel_address(s->name, tmp);
-		if (res) {
-			pr_err("Slab cache with size %d has lost its name\n",
-			       s->object_size);
-			continue;
-		}
-	}
-
 	WARN_ON(strchr(name, ' '));	/* It confuses parsers */
 	return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] slab_common: remove test if cache name is accessible
  2018-03-23 15:34 [PATCH] slab_common: remove test if cache name is accessible Mikulas Patocka
@ 2018-03-23 15:52 ` Christopher Lameter
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Lameter @ 2018-03-23 15:52 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton,
	linux-mm, linux-kernel

On Fri, 23 Mar 2018, Mikulas Patocka wrote:

> Since the commit db265eca7700 ("mm/sl[aou]b: Move duping of slab name to
> slab_common.c"), the kernel always duplicates the slab cache name when
> creating a slab cache, so the test if the slab name is accessible is
> useless.

Acked-by: Christoph Lameter <cl@linux.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-23 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 15:34 [PATCH] slab_common: remove test if cache name is accessible Mikulas Patocka
2018-03-23 15:52 ` Christopher Lameter

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).