From nobody Thu Sep 18 13:07:25 2025 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 20F0AC352A1 for ; Tue, 6 Dec 2022 08:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbiLFIiY (ORCPT ); Tue, 6 Dec 2022 03:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234292AbiLFIhy (ORCPT ); Tue, 6 Dec 2022 03:37:54 -0500 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABFC01CFF3 for ; Tue, 6 Dec 2022 00:37:17 -0800 (PST) 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=1670315835; 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=rziPuY01KKfy8j2XSe8zzbR1uYlLxhOS82Ju9DQEie0=; b=nryMVGmkL9uPJ4ZdK9rNDqaeTLYy6XSqxo0F+d8J7kJCWgeipUNGXsAeIrK6/AAzMZI/eC PIezq6NB2SNo9csOCLKnw5Vo1klZDYo2pnceZPAIH3Pn8CveAR5enFGYhgFEKzc+U5aqJL /7JGkyTJS8DWJm3ts4yWwbq6hs9/lTA= 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/rt: Add pid and comm when RT throttling activated Date: Tue, 6 Dec 2022 16:36:41 +0800 Message-Id: <20221206083641.103832-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" It is difficult to know which process consumes time when RT throttling activated. So add pid and comm for this case. Signed-off-by: Yajun Deng --- kernel/sched/rt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index ed2a47e4ddae..1f267ab1b59a 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1012,6 +1012,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt= _rq) =20 if (rt_rq->rt_time > runtime) { struct rt_bandwidth *rt_b =3D sched_rt_bandwidth(rt_rq); + struct task_struct *curr =3D rq_of_rt_rq(rt_rq)->curr; =20 /* * Don't actually throttle groups that have no runtime assigned @@ -1019,7 +1020,8 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt= _rq) */ if (likely(rt_b->rt_runtime)) { rt_rq->rt_throttled =3D 1; - printk_deferred_once("sched: RT throttling activated\n"); + printk_deferred_once("pid: %d, comm: %s, sched: RT throttling activated= \n", + curr->pid, curr->comm); } else { /* * In case we did anyway, make it go away, --=20 2.25.1