Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 8 Aug 2002 20:49:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 8 Aug 2002 20:49:33 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.101]:53203 "EHLO e1.ny.us.ibm.com") by vger.kernel.org with ESMTP id ; Thu, 8 Aug 2002 20:49:32 -0400 Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() To: Linus Torvalds Cc: Andries Brouwer , Andrew Morton , andrea@suse.de, davej@suse.de, lkml , Paul Larson , Rik van Riel X-Mailer: Lotus Notes Release 5.0.10 March 22, 2002 Message-ID: From: Hubertus Franke Date: Thu, 8 Aug 2002 20:53:25 -0400 X-MIMETrack: Serialize by Router on D01ML244/01/M/IBM(Build V60_M14_08012002 Release Candidate|August 01, 2002) at 08/08/2002 20:52:22 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3560 Lines: 84 I package my stuff up that allows to pull this into user space and run much more efficient pid allocation test for performance.... I'll also include the comparision numbers. Currently remote, so I don't have access to that info. Based on that though it seems with random pid deletion (we surely could argue about that one) there still seems reasonable benefits to "consider" a twolevel algo. More tomorrow. Hubertus Franke Enterprise Linux Group (Mgr), Linux Technology Center (Member Scalability) , OS-PIC (Chair) email: frankeh@us.ibm.com (w) 914-945-2003 (fax) 914-945-4425 TL: 862-2003 Linus Torvalds cc: Rik van Riel , Andries Brouwer , Andrew Morton , , , lkml , Paul Larson PM Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() On Thu, 8 Aug 2002, Linus Torvalds wrote: > > So let's just try Andries approach, suggested patch as follows.. "ps" seems to do ok from a visual standpoint at least up to 99 million. Maybe it won't look that good after that, I'm too lazy to test. The following trivial program is useful for efficiently allocating pid numbers without blowing chunks on the VM subsystem and spending all the time on page table updates - for people who want to test (look out: I've got dual 2.4GHz CPU's with HT, so getting up to 10+ million was easy, your milage may wary and at some point you should just compile a kernel that starts higher ;). Linus --- #include #include #include #include #include int main() { int i; for (i = 1; i < 250000; i++) { if (!vfork()) exit(1); if (waitpid(-1, NULL, WNOHANG) < 0) perror("waitpid"); } return 0; } - 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/