Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757761Ab0FOShT (ORCPT ); Tue, 15 Jun 2010 14:37:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754731Ab0FOShR (ORCPT ); Tue, 15 Jun 2010 14:37:17 -0400 Date: Tue, 15 Jun 2010 20:35:25 +0200 From: Oleg Nesterov To: Andrew Morton , Salman Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, peterz@infradead.org, tytso@google.com, torvalds@linux-foundation.org, walken@google.com Subject: [PATCH 0/1] (Was: Fix a race in pid generation that causes pids to be reused immediately.) Message-ID: <20100615183525.GA24577@redhat.com> References: <20100611224902.5039.60134.stgit@bumblebee1.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100611224902.5039.60134.stgit@bumblebee1.mtv.corp.google.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 821 Lines: 25 On 06/11, Salman wrote: > > A program that repeatedly forks and waits is susceptible to having the > same pid repeated, I agree this patch should fix this. But the kernel still can use the same pid twice in a row, I am wondering if there a simple solution to prevent this. Probably not, and this case is unlikely. While we are here, and given that many reviewers recently inspected alloc_pidmap(), probably someone can explain the mysterious checks in do/while loop ? See the patch I am going to send, it is on top on Salman's fix but doesn't really depend on it. Oleg. -- 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/