Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7119411rwb; Tue, 6 Dec 2022 01:09:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf5HmHtYeolpa9C5m9zWfD6yfERdcAI+oKVE0Y5EzNxpdVhPWzLHI+qmyhjeuvViAPgeU67+ X-Received: by 2002:a05:6402:b81:b0:45c:a651:8849 with SMTP id cf1-20020a0564020b8100b0045ca6518849mr7689951edb.209.1670317789624; Tue, 06 Dec 2022 01:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670317789; cv=none; d=google.com; s=arc-20160816; b=FDFvZuGkb0H0re6xRISi2QWs7IzWbJX0oPuGssgL1q/NwECvzUttyXXfKas5sQTBwC JrCyg/SWO6UfW1AibSnwJACsGDrOoRCPc/bKtKr8u/gnYK+q9w+o7onrzLmiIln3yFUI 0cBPGtNPSAWycrM2xBFb56mJveL01WowUn8NvLYtiE8npxMHJyNzwoOGumrprzOu4N3N D2a7e2EoCCPKTeycCtGdkpkFxSEJmVFRZ+MMz0FhZ7y1nO6LCamwTeujI2TRUtFW3dbk h3jvvV8MdubC42P0WwZwvGAwWkYdJifwJshyUv0b+Nx6WCe7Hb7qshon08B5OeePkSlw j8TQ== 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=rziPuY01KKfy8j2XSe8zzbR1uYlLxhOS82Ju9DQEie0=; b=Y1+R/SiWBkcNFO8Wxj5gZ13vgBWTfOcqoDrzBjG+1AoLMVcgNZKcT20SYAihsf1Thb GzvEnKHwe1i8ghzW0GnhimjsXzSvA7rIz5V5csUmNKLFE4GrDyXaftOrlABb9MWKAepe 8u2gEXMqipuyF6l7TKX9CEWMoZsaHTOfNd7620tlvPZ0nSZKDP/ZV0jdUxEdLFY0lZ1v 3EcfQCVqQAizZ1G1Xaq7tYTKCumUEJFse22WtPMisH/JOnaE0ZpJawAiKhFPt1jomYce ZNuhoVolcLLM97piFfCTL781zhx0poOTe5pK/dhsRBaaFL+rWCxTPH/a/zYB8axtB2sj Pp9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=nryMVGmk; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs33-20020a1709073ea100b007a7a3b40920si15102827ejc.995.2022.12.06.01.09.29; Tue, 06 Dec 2022 01:09:49 -0800 (PST) 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=nryMVGmk; 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 S232801AbiLFIiX (ORCPT + 79 others); Tue, 6 Dec 2022 03:38:23 -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: 8bit 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,SPF_HELO_PASS,SPF_PASS 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 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) if (rt_rq->rt_time > runtime) { struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq); + struct task_struct *curr = rq_of_rt_rq(rt_rq)->curr; /* * 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 = 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, -- 2.25.1