lkml.org 
[lkml]   [2007]   [Mar]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 06 Mar 2007 07:22:33 +0100
FromEric Dumazet <>
SubjectRe: [patch v2] epoll use a single inode ...
Davide Libenzi a écrit :
> On Mon, 5 Mar 2007, H. Peter Anvin wrote:
> 
>> Davide Libenzi wrote:
>>> Right now is using:
>>>
>>> 	this.len = sprintf(name, "[%u.%d]", current->pid, fd);
>>>
>>> That should be unique and not have the wraparound problem. Ack?
>>>
>> NAK, very much NAK.
>>
>> File descriptors aren't file structures, they're *pointers* to file
>> structures.
>>
>> It's perfectly possible -- downright common -- for a file descriptor to be
>> inherited by another process, and then the pid is recycled -- collision.
> 
> Ugh! Right! 64 bit counter it is ... :)

For epoll, I suspect this is harmless : Programs dont allocate epolls fd every 
milli second, but at startup only.

For pipes/sockets, using a 64 bits would be problematic, because sprintf() 
uses a divide for each digit. And a divide is slow. Ten divides are *very* slow.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-06 07:25    [from the cache]
©2003-2008