From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19282C7619A for ; Wed, 12 Apr 2023 21:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbjDLVMU (ORCPT ); Wed, 12 Apr 2023 17:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbjDLVMT (ORCPT ); Wed, 12 Apr 2023 17:12:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72C146A7F; Wed, 12 Apr 2023 14:12:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3DFD632B0; Wed, 12 Apr 2023 21:12:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39BE7C433D2; Wed, 12 Apr 2023 21:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681333937; bh=9gB2mGFB6sk7lKqjsy7MbN72ZEJ0ICs26aBiPeN3y+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rjkrSfP2YwvvRScBvxWN9x84liozbr35remjUYkZHRlO/Cswc2psrGCU0AdeqpNjf hOz2ECYBBlmIf7gRobYBN7hw44whuZGlFeHWZIQwkZlNGnCYf8TOSySYm8PrVoDKij 6UfVjVrA3O7JqxPGsGDWuMBtgewVER+Cn6EyBTQw= Date: Wed, 12 Apr 2023 14:12:16 -0700 From: Andrew Morton To: Chunguang Wu Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexey Dobriyan Subject: Re: [PATCH] fs/proc: add Kthread flag to /proc/$pid/status Message-Id: <20230412141216.c8f2c1313f34ee0100ac9ae4@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, 12 Apr 2023 22:34:02 +0800 Chunguang Wu 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?