Thread (37 messages) 37 messages, 7 authors, 2012-08-16

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

From: Christoph Lameter (Open Source) <hidden>
Date: 2012-08-09 19:10:12
Also in: lkml

On Thu, 9 Aug 2012, Shuah Khan wrote:
Moving these checks into kmem_cache_sanity_check() would mean return
path handling will change. The first block of sanity checks for name,
and size etc. are done before holding the slab_mutex and the second
block that checks the slab lists is done after holding the mutex.
Depending on which one fails, return handling is going to be different
in that if second block fails, mutex needs to be unlocked and when the
first block fails, there is no need to do that. Nothing that is too
complex to solve, just something that needs to be handled.
Right. The taking of the mutex etc is not depending on the parameters at
all. So its possible. Its rather simple.
Comments, thoughts on

1. just remove size from kmem_cache_sanity_check() parameters
or
2. move first block sanity checks into kmem_cache_sanity_check()

Personally I prefer the first option to avoid complexity in return path
handling. Would like to hear what others think.
We already have to deal with the return path handling for other failure
cases.

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help