[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703051621590.3998@woody.linux-foundation.org>
Date: Mon, 5 Mar 2007 16:25:36 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Davide Libenzi <davidel@...ilserver.org>
cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Dumazet <dada1@...mosbay.com>
Subject: Re: [patch v2] epoll use a single inode ...
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
-
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