Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6075899rwb; Sun, 11 Dec 2022 18:36:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ojQxt+Mem5sl3RJ8nxYrkW0oygmDeLx/8CMKz73JX4CuR1PBRzgAM+HGGInbMLiN6EEIF X-Received: by 2002:a17:90a:4404:b0:218:87e5:19f4 with SMTP id s4-20020a17090a440400b0021887e519f4mr14752804pjg.3.1670812575170; Sun, 11 Dec 2022 18:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670812575; cv=none; d=google.com; s=arc-20160816; b=U4J2p1CoyDfA8uZPdY/g7l3r1ypQKm4MvVjFDW79mvHj0Dc0TR8UqhjDnr94exLEzq /yXBQTKYj1n2AliiSeoDSCVYojAMuBHGom1geAbvE+mwohcD/qbLQQEU6SXgppR8P5NT sAmvCmJV+EuXaK8LXrBM7XWxcVur+6gg9NVEy9bGbsOu51Eo74WTPH+jUcoEnxlZvFsQ PKNDDQN/o8IAkyFQTVDwJL09vcQy8ID9Ffl9mYyHTzM+QBl7pR8iC6XqZpGpzLtJbCyA s98d4HNHEC6GkX3a1jUOenQLgQfVlZd2ynzqWMLCakKXUNhpolgdTKMb+TK76pZxkIq7 Psfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=bwXKTDhn3IwcBwhgVdwbQXe6w3acdV0zTCH6qBI6v14=; b=t8cBiYo6m+ZYvjpnsglPyEaYuq9MIWIdmFZLydpaaPFCazMIuWBV6dsLZhlKIqAjNv 2UjRYmlcSPWLiOG8z/XgE9huha5DFGH6SI/dMuIVSd/ObfDR3yQR298nEEdxM0XmbYqh nheDNNpGHtKv3B/wNJhyYxwUy2n2GVIDH2XHw7JCK8pYsCfAvdNJBv+inrxn0PtSklPZ 0PU4+8ar4oDbbqqkDowShmHiOQrPRkdzD3lPiYBMiGytrAmj3Cw8C2kVEHGX5RndLuXO DPYCnkXGOjQCFRwiquQkzIr6J5UzRuOStqj4C2bg23IPp8OxllbkqzAFl83mOmgko/Xs bK+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IaKLGPaX; 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 c20-20020a6566d4000000b0047712cb3fe3si8247955pgw.590.2022.12.11.18.36.05; Sun, 11 Dec 2022 18:36:15 -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=IaKLGPaX; 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 S231220AbiLLCLM (ORCPT + 75 others); Sun, 11 Dec 2022 21:11:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbiLLCLK (ORCPT ); Sun, 11 Dec 2022 21:11:10 -0500 X-Greylist: delayed 321 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 11 Dec 2022 18:11:06 PST Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [IPv6:2001:41d0:1004:224b::bd]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 150A52C2 for ; Sun, 11 Dec 2022 18:11:05 -0800 (PST) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1670810740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bwXKTDhn3IwcBwhgVdwbQXe6w3acdV0zTCH6qBI6v14=; b=IaKLGPaXey3volonxg6iTmMvb6wyw1pKhu/g7aBgFeFNyVEHy3q3XMKHH8SaNIzncXeC8q 9D07skGJNY5uf71nRcaWiM8V8rbcLyIADJA5kMCEfPZIw7LkVHlsTfb8nzR4tM7YSL1P0J oSB3z5Cv+q3G6NaRmk+0VFdcy9KEdzk= Date: Mon, 12 Dec 2022 02:05:40 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yajun Deng" Message-ID: <7687e119c7b6beab06c4da41a6b4dcca@linux.dev> Subject: Re: [PATCH] sched/rt: Add pid and comm when RT throttling activated To: "Steven Rostedt" Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <20221209163606.53a2370e@gandalf.local.home> References: <20221209163606.53a2370e@gandalf.local.home> <20221206083641.103832-1-yajun.deng@linux.dev> 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_NONE,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 December 10, 2022 5:36 AM, "Steven Rostedt" wrote:= =0A=0A> On Tue, 6 Dec 2022 16:36:41 +0800=0A> Yajun Deng wrote:=0A> =0A>> It is difficult to know which process consumes ti= me when RT throttling=0A>> activated.=0A>> =0A>> So add pid and comm for = this case.=0A> =0A> Unfortunately, that only shows the process that "brok= e the camel's=0A> back"[1]. The things is, it is the amount of time *all*= RT tasks use to=0A> trigger throttling. You are only printing the task t= hat the throttling=0A> occurred on.=0A> =0A> Try running https://rostedt.= org/code/migrate.c . It will create a bunch of=0A> RT tasks, and they all= will throttle once it hits 950ms ever second.=0A> =0A> trace-cmd record = -e sched_switch ./migrate=0A> kernelshark=0A> =0A> Then plot all the migr= ate tasks.=0A> =0A> The above will demonstrate it very well.=0A=0AThanks = for your patient answer, I'll test it.=0A=0A> =0A> -- Steve=0A> =0A> [1] = https://en.wikipedia.org/wiki/Straw_that_broke_the_camel's_back=0A> =0A>>= Signed-off-by: Yajun Deng =0A>> ---=0A>> kernel/sc= hed/rt.c | 4 +++-=0A>> 1 file changed, 3 insertions(+), 1 deletion(-)=0A>= > =0A>> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c=0A>> index ed2= a47e4ddae..1f267ab1b59a 100644=0A>> --- a/kernel/sched/rt.c=0A>> +++ b/ke= rnel/sched/rt.c=0A>> @@ -1012,6 +1012,7 @@ static int sched_rt_runtime_ex= ceeded(struct rt_rq *rt_rq)=0A>> =0A>> if (rt_rq->rt_time > runtime) {=0A= >> struct rt_bandwidth *rt_b =3D sched_rt_bandwidth(rt_rq);=0A>> + struct= task_struct *curr =3D rq_of_rt_rq(rt_rq)->curr;=0A>> =0A>> /*=0A>> * Don= 't actually throttle groups that have no runtime assigned=0A>> @@ -1019,7= +1020,8 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)=0A>= > */=0A>> if (likely(rt_b->rt_runtime)) {=0A>> rt_rq->rt_throttled =3D 1;= =0A>> - printk_deferred_once("sched: RT throttling activated\n");=0A>> + = printk_deferred_once("pid: %d, comm: %s, sched: RT throttling activated\n= ",=0A>> + curr->pid, curr->comm);=0A>> } else {=0A>> /*=0A>> * In case we= did anyway, make it go away,