[lkml]   [2011]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] replace ida in workqueue with page-sized buffer

On Sat, Dec 18, 2010 at 09:10:18PM +0800, Hillf Danton wrote:
> The id of worker of global work queue is monitored with kernel library, ida.
> The ida in global work queue is redefined to be page-sized buffer,
> which is allocated when initializing workqueue.
> The new id allocator could monitor ids in the rage from 0 to INT_MAX.
> The buffer is used to store freed ids, and if the peak number of ids,
> in workqueue as whole, is not out of the capacity of the allocated
> buffer, there is no more allocation of buffer after initializing.
> The advantage looks that the new allocator runs faster.

I'm confused about why this is necessary. It's not like workqueue ID
alloc/dealloc is hot path to begin with (they're quite lazy) and
during worker creation / destruction ida is a quite insignificant
part, so what is it trying to optimize? It's not like ida allocator
is slow to begin with.

Also, the allocator looks quite dubious.

* What happens if more entries than what can fit in a page are freed?
It'll just lose track of it.

* ida guarantees that always the lowest available slot is allocated.
The new allocator doesn't.

So, why oh why?


 \ /
  Last update: 2011-01-08 15:05    [W:0.074 / U:1.304 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site