public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kmem_cache_alloc & kernel_lock
@ 2001-12-09 15:30 Frank Cornelis
  2001-12-09 15:47 ` Jens Axboe
  2001-12-09 17:43 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Cornelis @ 2001-12-09 15:30 UTC (permalink / raw)
  To: linux-kernel

Hi,

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

Thanks in advance?

Frank.



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

* Re: kmem_cache_alloc & kernel_lock
  2001-12-09 15:30 kmem_cache_alloc & kernel_lock Frank Cornelis
@ 2001-12-09 15:47 ` Jens Axboe
  2001-12-09 17:43 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2001-12-09 15:47 UTC (permalink / raw)
  To: Frank Cornelis; +Cc: linux-kernel

On Sun, Dec 09 2001, Frank Cornelis wrote:
> Hi,
> 
> Can I use kmem_cache_alloc(mycache_cachep, SLAB_KERNEL) within
> a kernel_lock/kernel_unlock block? Or should it be SLAB_ATOMIC?

GFP_KERNEL is ok, you can sleep with the kernel lock held.

-- 
Jens Axboe


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

* Re: kmem_cache_alloc & kernel_lock
  2001-12-09 15:30 kmem_cache_alloc & kernel_lock Frank Cornelis
  2001-12-09 15:47 ` Jens Axboe
@ 2001-12-09 17:43 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2001-12-09 17:43 UTC (permalink / raw)
  To: Frank Cornelis; +Cc: linux-kernel


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.

	Ingo


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

end of thread, other threads:[~2001-12-09 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-09 15:30 kmem_cache_alloc & kernel_lock Frank Cornelis
2001-12-09 15:47 ` Jens Axboe
2001-12-09 17:43 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox