Re: [PATCH 03/16] kdb: Use real_parent when displaying a list of processes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Doug Anderson <dianders@xxxxxxxxxxxx>
- Subject: Re: [PATCH 03/16] kdb: Use real_parent when displaying a list of processes
- From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
- Date: Thu, 19 May 2022 18:48:40 -0500
- Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Vincent Guittot <vincent.guittot@xxxxxxxxxx>, Dietmar Eggemann <dietmar.eggemann@xxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Mel Gorman <mgorman@xxxxxxx>, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Linux PM <linux-pm@xxxxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>, Johannes Berg <johannes@xxxxxxxxxxxxxxxx>, linux-um@xxxxxxxxxxxxxxxxxxx, Chris Zankel <chris@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, Kees Cook <keescook@xxxxxxxxxxxx>, Jann Horn <jannh@xxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, Robert OCallahan <roc@xxxxxxxxx>, Kyle Huey <khuey@xxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Jason Wessel <jason.wessel@xxxxxxxxxxxxx>, Daniel Thompson <daniel.thompson@xxxxxxxxxx>, Douglas Miller <dougmill@xxxxxxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>
- In-reply-to: <CAD=FV=UFK7h0oHGJ23y37ShO+z4vt9ubGE9E4m=jMECgNAAHgA@mail.gmail.com> (Doug Anderson's message of "Thu, 19 May 2022 13:52:22 -0700")
- References: <871qwq5ucx.fsf_-_@email.froward.int.ebiederm.org> <20220518225355.784371-3-ebiederm@xmission.com> <CAD=FV=UFK7h0oHGJ23y37ShO+z4vt9ubGE9E4m=jMECgNAAHgA@mail.gmail.com>
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Doug Anderson <dianders@xxxxxxxxxxxx> writes:
> Hi,
>
> On Wed, May 18, 2022 at 3:54 PM Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>>
>> kdb has a bug that when using the ps command to display a list of
>> processes, if a process is being debugged the debugger as the parent
>> process.
>>
>> This is silly, and I expect it never comes up in ptractice. As there
>> is very little point in using gdb and kdb simultaneously. Update the
>> code to use real_parent so that it is clear kdb does not want to
>> display a debugger as the parent of a process.
>
> So I would tend to defer to Daniel, but I'm not convinced that the
> behavior you describe for kdb today _is_ actually silly.
>
> If I was in kdb and I was listing processes, I might actually want to
> see that a process's parent was set to gdb. Presumably that would tell
> me extra information that might be relevant to my debug session.
>
> Personally, I'd rather add an extra piece of information into the list
> showing the real parent if it's not the same as the parent. Then
> you're not throwing away information.
The name of the field is confusing for anyone who isn't intimate with
the implementation details. The function getppid returns
tsk->real_parent->tgid.
If kdb wants information of what the tracer is that is fine, but I
recommend putting that information in another field.
Given that the original description says give the information that ps
gives my sense is that kdb is currently wrong. Especially as it does
not give you the actual parentage anywhere.
I can certainly be convinced, but I do want some clarity. It looks very
attractive to rename task->parent to task->ptracer and leave the field
NULL when there is no tracer.
Eric
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]