lkml.org 
[lkml]   [2008]   [Apr]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 15 Apr 2008 08:13:27 +0200
FromNadia Derbey <>
SubjectRe: [PATCH 00/13] Re: Scalability requirements for sysv ipc
Manfred Spraul wrote:
> Nadia Derbey wrote:
> 
>>
>> Well, 1 interface changes, 1 is added and another one went away:
>>
>> 1) for the preload part (it becomes like the radix-tree preload part):
>>
>> int idr_pre_get(struct idr *, gfp_t);
>> would become
>> int idr_pre_get(gfp_t);
>>
> Btw, that's one point I didn't understand about the idr code:
> Is it interrupt-safe? It uses spin_lock_irqsave and gfp_t, this implies 
> that it could be called from all contexts.
> 
> But the prealloc made me a bit nervous: does it handle idr_pre_get(); 
> interrupt with another idr_pre_get(), add, pre_get_end, interrupt ends, 
> ... correctly?

I don't know if I'm answering your question, but after allocating, 
idr_pre_get() calls free_layer() which is the routine that inserts the 
allocated memory into the idr free list. And free_layer() calls 
spin_lock_ir_save() to protect this free list modification. So it should 
be safe?

> 
> If it's only intended to be called from process context I would remove 
> the _irqsave and perhaps add an assert(!in_interrupt())

Well, I guess it might be called from any context, since the 
kmem_cache_alloc is called with the gfp_mask routine's parameter?


Regards,
Nadia


\
 
 \ /
  Last update: 2008-04-15 08:19    [from the cache]
©2003-2008