From: Eric Dumazet <eric.dumazet@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/2] posix-timers: move global timer id management to signal_struct v4
Date: Tue, 20 Sep 2011 00:23:27 +0200 [thread overview]
Message-ID: <1316471007.2455.24.camel@edumazet-laptop> (raw)
In-Reply-To: <1316468925-16754-1-git-send-email-andi@firstfloor.org>
Le lundi 19 septembre 2011 à 14:48 -0700, Andi Kleen a écrit :
> From: Andi Kleen <ak@linux.intel.com>
>
> Move the global posix timer ids IDR to signal_struct. This removes
> a minor global scalability bottleneck and also allows to finally limit
> the number of process timers in a sane way (see next patch)
>
> I put it into signal_struct following the other posix timer per process
> structures.
>
> v2: Now with locking again (thanks Eric)
> v3: Fix the locking too (Eric Dumazet)
> v4: Use a mutex. Get rid of retry loop.
> idr_pre_get() is still there to avoid major surgery in lib/idr.c.
> Random gleixnerfication
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> + mutex_lock(&sig->idr_lock);
> + error = -EAGAIN;
> + if (idr_pre_get(&sig->posix_timers_id, GFP_KERNEL))
> + error = idr_get_new(&sig->posix_timers_id, new_timer,
> + &new_timer_id);
> + mutex_unlock(&sig->idr_lock);
> if (error) {
On 64bit arches :
IDR_FREE_MAX=12 && sizeof(struct idr_layer)=544
This means idr_pre_get() consumes 6528 bytes of spare space per process,
even if only one posix timer is used.
I guess we should allow idr to call slab directly in this case (only a
mutex held, it's safe to sleep in slab), and not have this per idr
reserve/free_list : This was done because of some idr callers using a
spinlock.
I dont believe its major idr surgery :)
next prev parent reply other threads:[~2011-09-19 22:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 21:48 [PATCH 1/2] posix-timers: move global timer id management to signal_struct v4 Andi Kleen
2011-09-19 21:48 ` [PATCH 2/2] posix-timers: limit the number of posix timers per process v2 Andi Kleen
2011-09-19 22:23 ` Eric Dumazet [this message]
2011-09-19 22:36 ` [PATCH 1/2] posix-timers: move global timer id management to signal_struct v4 Andi Kleen
2011-09-19 22:41 ` Eric Dumazet
2011-09-19 23:07 ` Eric Dumazet
2011-09-19 23:11 ` Andi Kleen
2011-09-19 23:15 ` Eric Dumazet
2011-09-20 9:51 ` Thomas Gleixner
2011-09-20 9:19 ` Thomas Gleixner
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=1316471007.2455.24.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.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