[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1316471007.2455.24.camel@edumazet-laptop>
Date: Tue, 20 Sep 2011 00:23:27 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: tglx@...utronix.de, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/2] posix-timers: move global timer id management to
signal_struct v4
Le lundi 19 septembre 2011 à 14:48 -0700, Andi Kleen a écrit :
> From: Andi Kleen <ak@...ux.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@...ux.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 :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists