This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [PATCH] kexec: set prstatus.pr_pid to cpu id when current->pid is 0
- From: Simon Horman <horms at verge dot net dot au>
- To: "Eric W. Biederman" <ebiederm at xmission dot com>
- Cc: Hui Zhu <teawater at gmail dot com>, Andrew Morton <akpm at linux-foundation dot org>, WANG Cong <xiyou dot wangcong at gmail dot com>, "Paul E. McKenney" <paulmck at linux dot vnet dot ibm dot com>, Simon Kagstrom <simon dot kagstrom at netinsight dot net>, kexec at lists dot infradead dot org, linux-kernel at vger dot kernel dot org, gdb at sourceware dot org
- Date: Tue, 3 Aug 2010 17:36:48 +0900
- Subject: Re: [PATCH] kexec: set prstatus.pr_pid to cpu id when current->pid is 0
- References: <AANLkTikuUi=i6Lk-ZpE65Gr0tWOeVnrnpWPe85T=J=Ph@mail.gmail.com> <m1zkx4w3hx.fsf@fess.ebiederm.org> <AANLkTi=-By6ZWjo9bW0s4MndFftHegROO7oa0jbpnCho@mail.gmail.com> <m1d3u0un7b.fsf@fess.ebiederm.org>
On Tue, Aug 03, 2010 at 01:15:04AM -0700, Eric W. Biederman wrote:
> Hui Zhu <teawater@gmail.com> writes:
>
> > On Tue, Aug 3, 2010 at 15:37, Eric W. Biederman <ebiederm@xmission.com> wrote:
> >> Hui Zhu <teawater@gmail.com> 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.