Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 8 Aug 2002 18:21:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 8 Aug 2002 18:21:27 -0400 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:18703 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Thu, 8 Aug 2002 18:21:26 -0400 Date: Thu, 8 Aug 2002 15:26:00 -0700 (PDT) From: Linus Torvalds To: Hubertus Franke cc: Rik van Riel , Andries Brouwer , Andrew Morton , , , lkml , Paul Larson Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() In-Reply-To: Message-ID: 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: 1253 Lines: 42 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/