mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Eric Dumazet <dada1@cosmosbay.com>
Subject: Re: [patch v2] epoll use a single inode ...
Date: Mon, 5 Mar 2007 16:25:36 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703051621590.3998@woody.linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0703051609430.4907@alien.or.mcafeemobile.com>



On Mon, 5 Mar 2007, Davide Libenzi wrote:

> On Mon, 5 Mar 2007, Linus Torvalds wrote:
> > 
> > It's much better to do something like
> > 
> > 	static unsigned int epoll_inode;
> > 
> > 	this.len = sprintf(name, "[%u]", ++epoll_inode);
> > 
> > if you just need some pseudo-unique name to distinguish two epoll things 
> > from each other (vs from a dup'ed fd).
> 
> Heh, this is what Al was saying ;)
> I'm fine with that, but how about counter cycles (going back to zero)? 
> Should we care to handle them correctly? 

Since this is not actually *used* for anything but showing the fd's in 
/proc/<pid>/fd/ etc, no. In fact, an integer will wrap a *lot* less than a 
kernel data structure will be re-used, so even with the simple "wraps 
every 4G uses", you're still better off.

IOW, if the thing actually _mattered_ we should use some bitmap allocator 
or similar (eg pidmaps etc), but with something where the only reason 
really is as a visible indicator of difference for a user that happens to 
look, simple-and-stupid is better.

		Linus

  parent reply	other threads:[~2007-03-06  0:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05 23:41 Davide Libenzi
2007-03-06  0:00 ` Linus Torvalds
2007-03-06  0:12   ` Davide Libenzi
2007-03-06  0:20     ` Davide Libenzi
2007-03-06  0:25     ` Linus Torvalds [this message]
2007-03-06  2:25       ` H. Peter Anvin
2007-03-06  2:34         ` Davide Libenzi
2007-03-06  2:37           ` H. Peter Anvin
2007-03-06  2:43             ` Davide Libenzi
2007-03-06  6:22               ` Eric Dumazet
2007-03-06  6:31                 ` Davide Libenzi
2007-03-06  6:37                   ` Davide Libenzi
2007-03-06 16:28                 ` H. Peter Anvin
2007-03-06 17:09                   ` Linus Torvalds
2007-03-06 17:14                     ` H. Peter Anvin
2007-03-06 17:12                   ` Eric Dumazet
2007-03-06 17:19                     ` Linus Torvalds
2007-03-06 17:27                       ` H. Peter Anvin
2007-03-06 17:28                       ` Eric Dumazet
2007-03-06 18:10                         ` Eric Dumazet
2007-03-06 20:20                           ` Eric Dumazet
2007-03-07  3:47                             ` Linus Torvalds
2007-03-07  5:40                               ` H. Peter Anvin
2007-03-07  6:57                               ` Eric Dumazet
2007-03-07  7:13                                 ` H. Peter Anvin
2007-03-07 23:46                             ` Sami Farin
2007-03-06 18:10                   ` Davide Libenzi
2007-03-10  8:06     ` Pavel Machek
2007-03-10  8:24       ` Davide Libenzi

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.0703051621590.3998@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=dada1@cosmosbay.com \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®