linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab_common: fix the check for duplicate slab names
@ 2014-03-04 22:13 Mikulas Patocka
  2014-03-04 22:48 ` David Rientjes
  2014-03-25 17:03 ` Mike Snitzer
  0 siblings, 2 replies; 10+ messages in thread
From: Mikulas Patocka @ 2014-03-04 22:13 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Jonathan Brassow, Alasdair G. Kergon, Pekka Enberg, linux-mm,
	dm-devel

The patch 3e374919b314f20e2a04f641ebc1093d758f66a4 is supposed to fix the
problem where kmem_cache_create incorrectly reports duplicate cache name
and fails. The problem is described in the header of that patch.

However, the patch doesn't really fix the problem because of these
reasons:

* the logic to test for debugging is reversed. It was intended to perform
  the check only if slub debugging is enabled (which implies that caches
  with the same parameters are not merged). Therefore, there should be
  #if !defined(CONFIG_SLUB) || defined(CONFIG_SLUB_DEBUG_ON)
  The current code has the condition reversed and performs the test if
  debugging is disabled.

* slub debugging may be enabled or disabled based on kernel command line,
  CONFIG_SLUB_DEBUG_ON is just the default settings. Therefore the test
  based on definition of CONFIG_SLUB_DEBUG_ON is unreliable.

This patch fixes the problem by removing the test
"!defined(CONFIG_SLUB_DEBUG_ON)". Therefore, duplicate names are never
checked if the SLUB allocator is used.

Note to stable kernel maintainers: when backporint this patch, please
backport also the patch 3e374919b314f20e2a04f641ebc1093d758f66a4.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org	# 3.6+

---
 mm/slab_common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-3.14-rc5/mm/slab_common.c
===================================================================
--- linux-3.14-rc5.orig/mm/slab_common.c	2014-03-04 22:47:02.000000000 +0100
+++ linux-3.14-rc5/mm/slab_common.c	2014-03-04 22:47:08.000000000 +0100
@@ -56,7 +56,7 @@ static int kmem_cache_sanity_check(struc
 			continue;
 		}
 
-#if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON)
+#if !defined(CONFIG_SLUB)
 		/*
 		 * For simplicity, we won't check this in the list of memcg
 		 * caches. We have control over memcg naming, and if there

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2014-07-22 22:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 22:13 [PATCH] slab_common: fix the check for duplicate slab names Mikulas Patocka
2014-03-04 22:48 ` David Rientjes
2014-03-25 17:03 ` Mike Snitzer
2014-03-25 18:07   ` Christoph Lameter
2014-05-23 20:16     ` Mike Snitzer
2014-05-23 21:28       ` Pekka Enberg
2014-05-24  0:37         ` Mike Snitzer
2014-07-22 22:14         ` Mike Snitzer
2014-07-22 22:41           ` [patch] " David Rientjes
2014-07-22 22:58             ` [git pull] stable mm/slab_common.c fix for 3.16-rc7 Mike Snitzer

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