From: Pavel Emelyanov <xemul@parallels.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Michael Kerrisk <mtk.manpages@gmail.com>,
linux-api@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] posix timers: Allocate timer id per process
Date: Fri, 15 Feb 2013 09:13:19 +0400 [thread overview]
Message-ID: <511DC3EF.60904@parallels.com> (raw)
In-Reply-To: <CA+1xoqdk5PArnjSnu=7gUq_4got09a0PxBd4Yy=inezPTGsdAA@mail.gmail.com>
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
> .
>
next prev parent reply other threads:[~2013-02-15 5:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 16:18 [PATCH 0/3] posix timers: Extend kernel API to report more info about timers Pavel Emelyanov
2013-02-14 16:19 ` [PATCH 1/3] posix timers: Allocate timer id per process Pavel Emelyanov
2013-02-14 20:13 ` Sasha Levin
2013-02-15 5:13 ` Pavel Emelyanov [this message]
2013-02-14 16:19 ` [PATCH 2/3] posix timers: Add syscall that lists timer IDs armed by process Pavel Emelyanov
2013-02-14 16:19 ` [PATCH 3/3] posix timers: Add syscall that works on timer sigevent Pavel Emelyanov
2013-02-17 13:42 ` Jann Horn
2013-02-17 18:53 ` Pavel Emelyanov
2013-02-21 1:21 ` [PATCH 0/3] posix timers: Extend kernel API to report more info about timers Matthew Helsley
2013-02-21 10:35 ` Pavel Emelyanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=511DC3EF.60904@parallels.com \
--to=xemul@parallels.com \
--cc=levinsasha928@gmail.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtk.manpages@gmail.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox