[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703191834530.3733@alien.or.mcafeemobile.com>
Date: Mon, 19 Mar 2007 18:36:12 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Eric Dumazet <dada1@...mosbay.com>
cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 6/13] signal/timer/event fds v7 - timerfd core ...
On Tue, 20 Mar 2007, Eric Dumazet wrote:
> Davide Libenzi a écrit :
>
> > +struct timerfd_ctx {
> > + struct hrtimer tmr;
> > + ktime_t tintv;
> > + spinlock_t lock;
> > + wait_queue_head_t wqh;
> > + unsigned long ticks;
> > +};
>
> > +static struct kmem_cache *timerfd_ctx_cachep;
>
> > + timerfd_ctx_cachep = kmem_cache_create("timerfd_ctx_cache",
> > + sizeof(struct timerfd_ctx),
> > + 0, SLAB_PANIC, NULL, NULL);
>
>
> Do we really expect thousands of active timerfd_ctx ?
>
> If not, using kmalloc()/kfree() would be fine, because sizeof(struct
> timerfd_ctx) is so small.
>
> on SMP / NUMA platforms, each new kmem_cache is rather expensive. (memory
> allocated at kmem_cache_create(), but also memory used when cache is not
> empty, with slabs in freelist for each cpu/node)
>
> Using a general cache might be cheaper : No memory overhead for yet another
> kmem_cache.
>
> I know individual caches are good to spot memory leaks, but in timerfd case,
> you dont have mem leaks, do you ? :)
Silly you, of course not :)
Yes, I gues I can use kmalloc/kfree for those fds ...
- Davide
Powered by blists - more mailing lists