From patchwork Wed May 16 18:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 136047 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1275538lji; Wed, 16 May 2018 11:19:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq807hfo4g/fUzgUlb23K4a6j9Gf+w7848q3clr4/hay6qpDaWgKPW9vM1Ns5djielGyHO9 X-Received: by 2002:a62:6105:: with SMTP id v5-v6mr1986200pfb.197.1526494744866; Wed, 16 May 2018 11:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526494744; cv=none; d=google.com; s=arc-20160816; b=bsSdJvss8FoEXM3V2aDGvIWbzwhVGwMPVEp9cmAYhHdccBoLKH6LJm/XGayFyr5sqt Go4uRYqVfMU/CT/t82IzG0OWbFEm5SE0OZ4yV4JorssNDfjnaDY0sjW4gCZATXwe3H7x N473eG5l+1kiclvMhnrw7whQHGVC7RJJIR71a66CjHRJsuJeUj6eVlxSMjH4ulwzCUNI fHHbG+YFIAvVv5lv5kjgja10mfEm0Rajc00Ql52NiKhZhO2qzCtb++6+zNUrslL7rkkK Ftj3PEaLJ2ZW5m2k/HILco3SczvredxSx3X1AziGKDcJfK8h8WJc83RegF6gH6+Uvy/5 k6GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=vcVhkBFx2J6KPYpgkHAk8R/hUTdSn4eyrJHk3UDvHU0=; b=QJOEkwN0aGc1D3k471IUWIel2YCEIV4lPnw02TpHv/YuBzY3y0wdtSLerERt98au9x lckvMwPObA3wcWYSlEMidIZlF1a+RpdhOXCKGR8v2U1d5lh3smDqmrF9xJ2qE+7UWChS eC22RhH6/n96JdM2UcdpS5ubeulPR9OHVpdQEZ084+mYZAAyyM6NutI3IWMHStaPEYbf YJh4zSVYe+7x3p1ObKt+38SbMxvCDzvjkj9Of/LR6L/HmhZSzHmK/B3VE2QRajVN/W8Z ECEk0kUhyao+vv8SUSOd90Z8HPjJu8m5/emu1zNc1kQJ8K+2wdHL+jesKnN6efbQCcQe bXfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQf6cWk4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16-v6si3061263pli.53.2018.05.16.11.19.04; Wed, 16 May 2018 11:19:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQf6cWk4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbeEPSTC (ORCPT + 29 others); Wed, 16 May 2018 14:19:02 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34580 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbeEPSS5 (ORCPT ); Wed, 16 May 2018 14:18:57 -0400 Received: by mail-wr0-f196.google.com with SMTP id p18-v6so2622714wrm.1 for ; Wed, 16 May 2018 11:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vcVhkBFx2J6KPYpgkHAk8R/hUTdSn4eyrJHk3UDvHU0=; b=CQf6cWk477gzkzgoWOeXPmqdLwPzUhawt1BxQ+KYkvSY8FMAK8UT4/BxwSOewT1g5b oqh5qkyFWuemwxBQ1oEJg3x1ZkAghMUNGVTO+J0H1XjWDDBk2pLmxohbRWhASkUt+CgR NGAqUlTNCFbbD8/T6C3Xsbrz7ay0PjD7IbtNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vcVhkBFx2J6KPYpgkHAk8R/hUTdSn4eyrJHk3UDvHU0=; b=GAHXqyKd6XHK/59BnPtWxC7V7Ocn0vUsNZW/zIEwq4Daz92fE0pNhien2Mxuwd2UfE xbLvDp6V3zfQqHOfX1CNKnHSRBi+E5r7E+K9kWb5rEaIMhiuJq740IXhIaEWlKZ7SM20 HZeP92TksrbGTa4lQosyEBKU9CfbebWSM0YEn2SU1JnUokgr6R9jDh/tM2eDcApnLEsO ad0XYXQpXXdxCXuGs5jBlTfMl7L0da9sDy2v/Dp6TRmmZOtocgCwn94ZvbM2lkk+qKqr itBKNIds0bbKtHFGzZq4KArS4CUHUSpg6g1sWToz+deB2dI4zZfkA5sYNOpWzGa71kPj vWJg== X-Gm-Message-State: ALKqPwcktpPbjvJ0urMBdInruxCo1Fj9LnHrBGINKjW4WLgmuTvmcOMz BI2Y4VychIO6MOqexjzZ7S3oPw== X-Received: by 2002:adf:b90a:: with SMTP id k10-v6mr1838455wrf.283.1526494736493; Wed, 16 May 2018 11:18:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:919e:ce91:18eb:c839]) by smtp.gmail.com with ESMTPSA id e39-v6sm386472wrg.92.2018.05.16.11.18.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 May 2018 11:18:55 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: patrick.bellasi@arm.com, viresh.kumar@linaro.org, tglx@linutronix.de, efault@gmx.de, juri.lelli@redhat.com, Vincent Guittot , "# v4 . 16+" Subject: [PATCH] sched/rt: fix call to cpufreq_update_util Date: Wed, 16 May 2018 20:18:39 +0200 Message-Id: <1526494719-23361-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With commit 8f111bc357aa ("cpufreq/schedutil: Rewrite CPUFREQ_RT support") schedutil governor uses rq->rt.rt_nr_running to detect whether a RT task is currently running on the CPU and to set frequency to max if necessary. cpufreq_update_util() is called in enqueue/dequeue_top_rt_rq() but rq->rt.rt_nr_running as not been updated yet when dequeue_top_rt_rq() is called so schedutil still considers that a RT task is running when the last task is dequeued. The update of rq->rt.rt_nr_running happens later in dequeue_rt_stack() Fixes: 8f111bc357aa ('cpufreq/schedutil: Rewrite CPUFREQ_RT support') Cc: # v4.16+ Signed-off-by: Vincent Guittot --- kernel/sched/rt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 7aef6b4..6e74d3d 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1001,8 +1001,6 @@ dequeue_top_rt_rq(struct rt_rq *rt_rq) sub_nr_running(rq, rt_rq->rt_nr_running); rt_rq->rt_queued = 0; - /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ - cpufreq_update_util(rq, 0); } static void @@ -1288,6 +1286,9 @@ static void dequeue_rt_stack(struct sched_rt_entity *rt_se, unsigned int flags) if (on_rt_rq(rt_se)) __dequeue_rt_entity(rt_se, flags); } + + /* Kick cpufreq (see the comment in kernel/sched/sched.h). */ + cpufreq_update_util(rq_of_rt_rq(rt_rq_of_se(back)), 0); } static void enqueue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flags)