From patchwork Thu Jul 20 08:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 123091 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2978786vqt; Thu, 20 Jul 2023 01:56:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFo6NJoicVBEk6aXDfmE4OS7aRnbzKeCSzbQh8mVuVmgn2wLPtQbbX4m9BcLDjIbJmCc40b X-Received: by 2002:a05:6402:8d6:b0:51e:1af0:3a90 with SMTP id d22-20020a05640208d600b0051e1af03a90mr4451938edz.37.1689843417328; Thu, 20 Jul 2023 01:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689843417; cv=none; d=google.com; s=arc-20160816; b=iOZnH7RNHnPPMwP99ym9Ogjcz4Ysnu4F/utdroJL4F2gVpElNFx17MCnr5T7AwAk5H D7NrDgKl5CvsYfL0GAEo5KAunWJIoVtxc7VQhcAtzZTjqjzktVyEjZ0jSRak8AUFpLmy KIdTc8ehdXWrI4ZVz5LQgtrXCua9rsOmHeuDuO0cE1Un74BITLxwNFZ+R7miPzgnRian 11o7PvlEISm8huRSM/BG526Ogizy3S18Gp0Zsd532Qj+wpM42UDQ31eVsUJnnaluhyKU gQtmVVe4hM38Oyvf3XCHXIT1NHOATvgseI4ynOsy3rN3bQCIxyp/4NqxlynRzjqyQlhY 1cqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=U7SNqNg8l9jcFOH2jbUPGRpUOcJQOOmYIXLh9NsQCGE=; fh=tYiG3tLjVNirZmCEAhO0ijnhlpkD5/sPPUKSOiTGBDQ=; b=SZfTfNMxq6xTHyGRiLemlxAfCZaBidUGGu9nIlMXH+bUe02cucgPHPUCV4LDS4q4SC zTSmUSTL9QVtPATQ3P/BlBtTaRrMOvDTWNgFDeEx3Dm+qra5smU41S8zcLjZa6JqtGlN vfqHIp3bPF4zCzCEmG5x9S64X6q4B6VSCwWHXq6yY8dGeQan7JyuZukEvEuKwuw0xWWy VM8mO9+WYc5gelE++IW3NqJwAOQr9QRIndkj0wDyrfFoArPid492aK9o41PI/n5f+Td/ 39gO6GCXgE6E2MRAngm0BL2UuFxlHjMadKmIEE+Zu8ZPG2FN1cLhypRRjbVXW7aoMae8 zICw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PzprmWEu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020aa7d4d5000000b0051e0e5d86absi499901edr.269.2023.07.20.01.56.33; Thu, 20 Jul 2023 01:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PzprmWEu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjGTIFj (ORCPT + 99 others); Thu, 20 Jul 2023 04:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbjGTIFh (ORCPT ); Thu, 20 Jul 2023 04:05:37 -0400 Received: from out-6.mta0.migadu.com (out-6.mta0.migadu.com [IPv6:2001:41d0:1004:224b::6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1050213C for ; Thu, 20 Jul 2023 01:05:35 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689840333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=U7SNqNg8l9jcFOH2jbUPGRpUOcJQOOmYIXLh9NsQCGE=; b=PzprmWEumOxHgWMjAnQUlo//3iHng93GvAUVcRI8HM47zTYzWx+C8g3YQuEyikGNdx45mQ ireIT+f9zZXtZZvez4TjWerWJwneQnBLYUL4KObDLiLOA6sgIDZzo95lusLeFS3gRoQQgc FpawkfcLM5qRnRhlMB5fB4clTxfPFAc= From: Yajun Deng To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] sched/debug: Print tgid in sched_show_task() Date: Thu, 20 Jul 2023 16:05:16 +0800 Message-Id: <20230720080516.1515297-1-yajun.deng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771929251365730309 X-GMAIL-MSGID: 1771929251365730309 Multiple blocked tasks are printed when the system hangs. They may have the same parent pid, but belong to different task groups. Printing tgid lets users better know whether these tasks are from the same task group or not. Signed-off-by: Yajun Deng --- kernel/sched/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9020d34b22fe..80feede4e7c3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9187,9 +9187,9 @@ void sched_show_task(struct task_struct *p) if (pid_alive(p)) ppid = task_pid_nr(rcu_dereference(p->real_parent)); rcu_read_unlock(); - pr_cont(" stack:%-5lu pid:%-5d ppid:%-6d flags:0x%08lx\n", - free, task_pid_nr(p), ppid, - read_task_thread_flags(p)); + pr_cont(" stack:%-5lu pid:%-5d tgid:%-5d ppid:%-6d flags:0x%08lx\n", + free, task_pid_nr(p), task_tgid_nr(p), + ppid, read_task_thread_flags(p)); print_worker_info(KERN_INFO, p); print_stop_info(KERN_INFO, p);