public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Chunguang Wu <aman2008@qq.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH] fs/proc: add Kthread flag to /proc/$pid/status
Date: Wed, 12 Apr 2023 14:12:16 -0700	[thread overview]
Message-ID: <20230412141216.c8f2c1313f34ee0100ac9ae4@linux-foundation.org> (raw)
In-Reply-To: <tencent_3E1CBD85D91AD4CDDCB5F429A3948EB94306@qq.com>

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?


       reply	other threads:[~2023-04-12 21:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_3E1CBD85D91AD4CDDCB5F429A3948EB94306@qq.com>
2023-04-12 21:12 ` Andrew Morton [this message]
2023-04-13 18:36   ` [PATCH] fs/proc: add Kthread flag to /proc/$pid/status Alexey Dobriyan
2023-04-14  9:27 Chunguang Wu
2023-04-14 15:17 ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2023-04-15  8:21 Chunguang Wu
2023-04-15 16:03 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230412141216.c8f2c1313f34ee0100ac9ae4@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adobriyan@gmail.com \
    --cc=aman2008@qq.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox