lkml.org 
[lkml]   [2013]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] posix timers: Allocate timer id per process
On 02/15/2013 12:13 AM, Sasha Levin wrote:
> On Thu, Feb 14, 2013 at 11:19 AM, Pavel Emelyanov <xemul@parallels.com> wrote:
>> From: Stanislav Kinsbursky <skinsbursky@parallels.com>
>>
>> Patch replaces global idr with global hash table for posix timers and
>> makes timer ids unique not globally, but per process. Next free timer id is
>> type of integer and stored on signal struct (posix_timer_id). If free timer
>> id reaches negative value on timer creation, it will be dropped to zero and
>> -EAGAIN will be returned to user.
>>
>> Hash table has 512 slots.
>> Key is constructed as follows:
>> key = hash_32(hash_32(current->signal) ^ posix_timer_id));
>>
>> Note: with this patch, id, returned to user, is not the minimal free
>> amymore. It means, that id, returned to user space in loop, listed below, will
>> be increasing on each iteration till INT_MAX and then dropped to zero:
>>
>> while(1) {
>> id = timer_create(...);
>> timer_delete(id);
>> }
>>
>> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
>> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
>
> Hi Pavel,
>
> Why not use linux/hashtable.h?

Simply because this patch was just picked from the previous discussions
as is :) I will tune it to use hashtable.h in the next iteration.

>
> Thanks,
> Sasha
> .
>




\
 
 \ /
  Last update: 2013-02-15 07:01    [W:0.131 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site