Re: kmem_cache_alloc & kernel_lock

From: Ingo Molnar (
Date: Sun Dec 09 2001 - 12:43:57 EST

On Sun, 9 Dec 2001, Frank Cornelis wrote:

> Can I use kmem_cache_alloc(mycache_cachep, SLAB_KERNEL) within a
> kernel_lock/kernel_unlock block? Or should it be SLAB_ATOMIC?

kernel_lock/kernel_unlock is not a spinlock in the classic Linux sense.
It's automatically undone on scheduling, so you can hold it while
rescheduling, and it will be automatically re-acquired once the process
gets runnable again.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:14 EST