From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28255 invoked by alias); 3 Aug 2010 08:37:05 -0000 Received: (qmail 28247 invoked by uid 22791); 3 Aug 2010 08:37:04 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from kirsty.vergenet.net (HELO kirsty.vergenet.net) (202.4.237.240) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Aug 2010 08:36:55 +0000 Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14]) by kirsty.vergenet.net (Postfix) with ESMTP id 44B1D245AA; Tue, 3 Aug 2010 18:36:51 +1000 (EST) Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100) id 08B1A4FEBC; Tue, 3 Aug 2010 17:36:48 +0900 (JST) Date: Tue, 03 Aug 2010 08:37:00 -0000 From: Simon Horman To: "Eric W. Biederman" Cc: Hui Zhu , Andrew Morton , WANG Cong , "Paul E. McKenney" , Simon Kagstrom , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, gdb@sourceware.org Subject: Re: [PATCH] kexec: set prstatus.pr_pid to cpu id when current->pid is 0 Message-ID: <20100803083647.GB15434@verge.net.au> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00019.txt.bz2 On Tue, Aug 03, 2010 at 01:15:04AM -0700, Eric W. Biederman wrote: > Hui Zhu writes: > > > On Tue, Aug 3, 2010 at 15:37, Eric W. Biederman wrote: > >> Hui Zhu writes: > >> > > > > Equal 0 is not a bug, the trouble is a lot of core's pid is same. > > > > This is what gdb say: > > /* Found an old thread with the same id. It has to be dead, > > otherwise we wouldn't be adding a new thread with the same id. > > The OS is reusing this id --- delete it, and recreate a new > > one. */ > > gdb bug compatibility is not a primary goal. Having an extensible > format and not inventing it totally out of the blue is the goal. > > The goal was always that something could post process the output of > the kernel crashdump and create something that is gdb compatible. It > looks to me like it would take just a moment to strip out all of the > idle threads. > > Claiming the pid is the cpu number when the pid is the idle pid gives > you no insulation against duplication, and it looses information. Agreed, there clearly an ambiguity brought in by this patch as the range of valid values for pids and cpus is essentially the same. Doing this in user-space is the right place, though I'm not really convinced its even correct there.