Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2415339ybt; Tue, 16 Jun 2020 05:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO93SE2jzeWXlUvugaZEMgfiX1HmsD8TN6xm2zkx5Ncsj51/zcZfCmpZL97Hj2qiVgBiqZ X-Received: by 2002:a05:6402:1216:: with SMTP id c22mr2478765edw.208.1592311264950; Tue, 16 Jun 2020 05:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592311264; cv=none; d=google.com; s=arc-20160816; b=yq/VtxFYAnyOoDr/C0qlTJceLR+sXc8utWuz41xxf3Hc7HyeU+xBpPuLNfJqgVNwF6 CpL0w9NixrJ679ElXN7GfUUxifMcOGnqRxAdrZK3nGjraTO6ECft/RA7Z2FPR7bgAERj 1H67BbuBdyQNsRB1b2rl5QHe1ih99fhv8m0dQ3A4MZ7wq6CdKAZAQrlyC4G77+KmGnr4 QmDpdmwL7GPdqg1eEbA+4iGBWMkxUhNBgaOgqh1sC89yU4vjLEtrWFXdQ3lhf0lTKM42 H+urMIpspjT4/VojwW6CZWMhscXoykDfoqGVeUWg55X472YV90rznBpQ+PBzlElklMOA ct1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8a5Uu8Ojh+EEaAMYwrwWAIeZglX6dHTI6tQEYhCG4XQ=; b=aYe+i8IH9hp7NmDFs56VBQap0WiLIFwVRBJsA59oj9sRCAms0toHbchC/MgxHGY0fC KjJXaaW7NFqvyfnIxpfgMnKywm0U+QSln4/lUQR89xLAe0AwLwVM7tlJ/3yqhBVFzgOk CWcAroC1fUp/9ucNiR3zvJTMtlYqIR6In7qAl0SCztfc+YaORob5Cv8UZ8IfWIw5l87U LAkkYKzvWe9X7KRjrUKOdUllwdv0HVviCphG42y1GrNvzGB2f26HrFsq8tsFXVNcDxjY aoXr5dTkQjk6xbpD5gafGDpCCnWglMttCwwjXsXO844vogDm142CTnN75wvZIWgw5HS0 q8Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si10299293edv.101.2020.06.16.05.40.41; Tue, 16 Jun 2020 05:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728553AbgFPMiA (ORCPT + 99 others); Tue, 16 Jun 2020 08:38:00 -0400 Received: from mail.loongson.cn ([114.242.206.163]:43326 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726261AbgFPMiA (ORCPT ); Tue, 16 Jun 2020 08:38:00 -0400 Received: from localhost.localdomain (unknown [114.242.248.106]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxH98Lvehev3dEAA--.118S2; Tue, 16 Jun 2020 20:37:36 +0800 (CST) From: Lichao Liu To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, Lichao Liu Subject: [PATCH] sched/rt: Don't active rt throtting when no running cfs task Date: Tue, 16 Jun 2020 20:37:29 +0800 Message-Id: <20200616123729.153430-1-liulichao@loongson.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9DxH98Lvehev3dEAA--.118S2 X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: xolxzxpfkd0qxorr0wxvrqhubq/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Active rt throtting will dequeue rt_rq from rq at least 50ms, When there is no running cfs task, do we still active it? Signed-off-by: Lichao Liu --- kernel/sched/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index df11d88c9895..d6524347cea0 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -961,12 +961,13 @@ 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 rq *rq = rq_of_rt_rq(rt_rq); /* * Don't actually throttle groups that have no runtime assigned * but accrue some time due to boosting. */ - if (likely(rt_b->rt_runtime)) { + if (likely(rt_b->rt_runtime) && rq->cfs.nr_running > 0) { rt_rq->rt_throttled = 1; printk_deferred_once("sched: RT throttling activated\n"); } else { -- 2.25.1