lkml.org 
[lkml]   [2023]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs/proc: add Kthread flag to /proc/$pid/status
On Wed, 12 Apr 2023 22:34:02 +0800 Chunguang Wu <aman2008@qq.com> wrote:

> user can know that a process is kernel thread or not.
>
> ...
>
> --- a/fs/proc/array.c
> +++ b/fs/proc/array.c
> @@ -434,6 +434,12 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
>
> task_state(m, ns, pid, task);
>
> + if ((mm == NULL) || (task->flags & PF_KTHREAD)) {
> + seq_puts(m, "Kthread:\tYes\n");
> + } else {
> + seq_puts(m, "Kthread:\tNo\n");
> + }
> +
> if (mm) {
> task_mem(m, mm);
> task_core_dumping(m, task);

Well.. Why is this information useful? What is the use case?

There are many ways of working this out from the existing output - why
is this change required?

\
 
 \ /
  Last update: 2023-04-12 23:12    [W:0.039 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site