LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch 6/13] signal/timer/event fds v7 - timerfd core ...
Date: Mon, 19 Mar 2007 18:36:12 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703191834530.3733@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <45FF2C7B.6080107@cosmosbay.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1155 bytes --]

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


      reply	other threads:[~2007-03-20  1:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 23:47 Davide Libenzi
2007-03-20  0:36 ` Eric Dumazet
2007-03-20  1:36   ` Davide Libenzi [this message]

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=Pine.LNX.4.64.0703191834530.3733@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [patch 6/13] signal/timer/event fds v7 - timerfd core ...' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).