Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 8 Aug 2002 15:20:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 8 Aug 2002 15:20:53 -0400 Received: from e35.co.us.ibm.com ([32.97.110.133]:30906 "EHLO e35.co.us.ibm.com") by vger.kernel.org with ESMTP id ; Thu, 8 Aug 2002 15:20:51 -0400 Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() From: Paul Larson To: Hubertus Franke Cc: Andries Brouwer , Andrew Morton , andrea@suse.de, Dave Jones , lkml , Linus Torvalds In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 08 Aug 2002 14:18:55 -0500 Message-Id: <1028834336.19434.327.camel@plars.austin.ibm.com> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 33 On Thu, 2002-08-08 at 13:56, Hubertus Franke wrote: > (a) Vanilla version which breaks down after 22K pids and > really sucks above 32.5K > (b) Bill Irwin's, which keeps track of which PID is free and > which one is not ? > (c) Andrea's patch which searches in the bitmap when we are > running out > (d) Paul's patch, which I believe was based on one of my earlier > submission (03/02) that essentially switches between (a)+(c) at > the break even point. > I feel (c) or (d) is a better solution over (a) and (b)... Open for > discussion. > I have a test program that does the random pid deletion and pid allocation > in user space. All what's required is to copy the get_pid() code from the > kernel into there... Can make that available ... > > I don't know what Paul has done to the patch since then .... It's pretty much the same, with a couple of small changes. After forward porting your patch and the one from AA's patches (hch says that one was actually done by Ihno Krumreich, thanks for the info), I added the fix from (c) for the race, and moved the check for if(flags & CLONE_IDLETASK) outside of get_pid into copy_process() since there's no need to call get_pid and return just to find out that we need to use 0. -Paul Larson - 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/