Re: [PATCH 1/2] posix-timers: move global timer id management tosignal_struct v4
From: Thomas Gleixner
Date: Tue Sep 20 2011 - 05:51:58 EST
On Tue, 20 Sep 2011, Eric Dumazet wrote:
> Le mardi 20 septembre 2011 Ã 00:36 +0200, Andi Kleen a Ãcrit :
> > > This means idr_pre_get() consumes 6528 bytes of spare space per process,
> > > even if only one posix timer is used.
> >
> > And? Given the now normal bloat level in the kernel that's small
> > potatoes.
That's not really a good excuse to create more bloat without spending
a few brain cycles.
> I see. Oh yes, you work for a known hardware vendor.
LOL
Aside of that this patch already adds sizeof(idr) + sizeof(mutex) to
every signal_struct unconditionally. There is no reason to do that. We
simply can have a pointer to
struct posix_timer_idr {
struct mutex lock;
struct idr idr;
};
and allocate that when a process creates the first posix timer.
Thinking more about that the question arises whether the global idr is
in fact a real scalability issue. The number of posix timers actually
used is usually pretty low and I doubt that they are created/deleted
with high frequency.
If it's just about limiting the per process posix timer allocation we
can achieve the same goal with a simple per process counter which
holds the number of allocated timers.
Thanks,
tglx