From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933960AbXCFGWr (ORCPT ); Tue, 6 Mar 2007 01:22:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933961AbXCFGWq (ORCPT ); Tue, 6 Mar 2007 01:22:46 -0500 Received: from gw1.cosmosbay.com ([86.65.150.130]:36880 "EHLO gw1.cosmosbay.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933960AbXCFGWq (ORCPT ); Tue, 6 Mar 2007 01:22:46 -0500 Message-ID: <45ED08A9.9050501@cosmosbay.com> Date: Tue, 06 Mar 2007 07:22:33 +0100 From: Eric Dumazet User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Davide Libenzi CC: "H. Peter Anvin" , Linus Torvalds , Linux Kernel Mailing List , Andrew Morton Subject: Re: [patch v2] epoll use a single inode ... References: <45ECD122.6020907@zytor.com> <45ECD3D4.5020305@zytor.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [86.65.150.130]); Tue, 06 Mar 2007 07:22:41 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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.