lkml.org 
[lkml]   [2006]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] fs: fcntl_setlease defies lease_init assumptions
From
Date
On Mon, 2006-05-08 at 08:12 -0700, Linus Torvalds wrote:
> Yeah, but CONFIG_DEBUG_SLAB is _really_ expensive.
>
> We do have a lot of very basic debug checks (unconditionally) in the
> kernel to verify various "must be true" kinds of things. It might slow
> things down a bit, but in general, I think anything that helps catch
> problems early tends to pay itself back very quickly. So I'm more than
> happy with a simple BUG_ON() in even a hot path, if it just ends up being
> compiled into a "test and branch to unlikely" and doesn't need any costly
> locking etc around it.

I was under the impression that virt_to_page() is expensive, even more
so on NUMA. Do we really want this check included unconditionally in
slab free hot path?

Pekka

text data bss dec hex filename
9279 664 80 10023 2727 mm/slab.o (vanilla uma)
9327 664 80 10071 2757 mm/slab.o (debug uma)
13464 2596 24 16084 3ed4 mm/slab.o (vanilla numa)
13492 2596 24 16112 3ef0 mm/slab.o (debug numa)

diff --git a/mm/slab.c b/mm/slab.c
index c32af7e..8ace45b 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3077,6 +3077,8 @@ static inline void __cache_free(struct k
check_irq_off();
objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));

+ BUG_ON(!PageSlab(virt_to_page(objp)));
+
/* Make sure we are not freeing a object from another
* node to the array cache on this cpu.
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-08 18:09    [W:0.065 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site