Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761311AbXEaJ30 (ORCPT ); Thu, 31 May 2007 05:29:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760599AbXEaJ3G (ORCPT ); Thu, 31 May 2007 05:29:06 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:59941 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758280AbXEaJ3E (ORCPT ); Thu, 31 May 2007 05:29:04 -0400 Date: Thu, 31 May 2007 11:26:40 +0200 From: Ingo Molnar To: Eric Dumazet Cc: Linus Torvalds , Davide Libenzi , Ulrich Drepper , Jeff Garzik , Zach Brown , Linux Kernel Mailing List , Arjan van de Ven , Christoph Hellwig , Andrew Morton , Alan Cox , Evgeniy Polyakov , "David S. Miller" , Suparna Bhattacharya , Jens Axboe , Thomas Gleixner Subject: Re: Syslets, Threadlets, generic AIO support, v6 Message-ID: <20070531092640.GA2504@elte.hu> References: <465D286E.2080807@redhat.com> <20070530084252.GA15708@elte.hu> <465DE992.6070803@redhat.com> <20070531061303.GA4436@elte.hu> <20070531093523.a6a62833.dada1@cosmosbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070531093523.a6a62833.dada1@cosmosbay.com> User-Agent: Mutt/1.4.2.2i X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.0.3 -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1824 Lines: 43 * Eric Dumazet wrote: > > speedup: i suggested O_ANY 6 years ago as a speedup to Apache - > > non-linear fds are cheaper to allocate/map: > > > > http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg23820.html > > > > (i definitely remember having written code for that too, but i > > cannot find that in the archives. hm.) In theory we could avoid > > _all_ fd-bitmap overhead as well and use a per-process list/pool of > > struct file buffers plus a maximum-fd field as the 'non-linear fd > > allocator' (at the price of only deallocating them at process exit > > time). > > Only very few apps need to open more than 100.000 files. yes. I did not list it as a primary reason for private fds, it's just a nice side-effect. As long as the other apps are not hurt, i see no problem in improving the >100K open files case. > As these files are likely sockets, O_ANY is not a solution. why not? It would be a natural thing to extend sys_socket() with a 'flags' parameter and pass in O_ANY (along with any other possible fd parameter like O_NDELAY, which could be inherited over connect()). > A trick is to try to keep first 64 handles freed, so that kernel wont > consume too much cpu time and cache in get_unused_fd() > > http://lkml.org/lkml/2005/9/15/307 this is basically a user-space front-end cache to fd allocation - which duplicates data needlessly. I dont see any problem with doing this in the kernel. (Also, obviously 'first 64 handles' could easily break with certain types of apps so glibc cannot do this.) Ingo - 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/