From patchwork Thu May 17 07:16:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 136118 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1924842lji; Thu, 17 May 2018 00:16:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZou2owyMzSYdGgDZuzGpLynx2zv3aEUhCDkKBSyJwPci9CEut8UUjilsy77Oh4gWV3iPIwC X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr3285835pgn.117.1526541412222; Thu, 17 May 2018 00:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526541412; cv=none; d=google.com; s=arc-20160816; b=U/ahziwXiUXea/8TPXUDUJThmohXAfxs9z7HY9OBUNn8Y/w5HfC5sBQytOhKbkR9rH Ny37PGI1saEDClxAUTjKh9v3H/WtA0o8WmKDWWZc+iYfIxq22om0q+BGaowc5hXgz845 dZSx1mMHe7X+R0QWAIpX7CnAzCIZMzvAz/jV6e8SoVG3bk6SurJ47KZQZdTffzBOJrEP aaC6Gd50nT0oMLjCvamYkr6s+3oo116uKW+ng3+XgqGlLQXal7J9JYFUkEpj38lOC8mf 300gdhscduiCR+/vIJK19Ut7PQ5StmaoPHIP4zH5iUkXBAENlMSJnAh9n8kzAA7cVA1V JW3w== 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=CSkKLVTdxlSa3Cw3FnP5t9YpbHa3SOsFzZ2PlgCXSL8=; b=0vKVjuVzPUIbnezz4TdNqUTI374ZQWdL8f9qbdNVCQ8aIefVhkDXONKzsSqfuAeBJe bTRQd0ToPuI0vRHyKJqYjeeGwwsR0+592Cd22URluDZsLKz1d7Fo2KUaZtOtQx1gg3mR 9WqDzkKbGuWo/GDRvUGOO5eDz0jQDTkbbg9GUjDlvWdhUIHlJmbLE2NZ2pewKrafKww1 uMn5aKRaqwLD3GoUaYcd4qnMy5wywavXRxNfRDa9GU4aTFgtoUUgWN6kQtrTPIRRzn6B 3Fo8xmfz8c/zPd6LzjRLpsZDINnR6wtGhbesfkkHJiqU8uU3o7f9nMBTL/mOrvG0b/qe Wj8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FjceO5g7; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 h1-v6si3528955pgn.430.2018.05.17.00.16.51; Thu, 17 May 2018 00:16:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=FjceO5g7; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1751274AbeEQHQv (ORCPT + 11 others); Thu, 17 May 2018 03:16:51 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38007 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeEQHQu (ORCPT ); Thu, 17 May 2018 03:16:50 -0400 Received: by mail-wm0-f65.google.com with SMTP id m129-v6so6956842wmb.3 for ; Thu, 17 May 2018 00:16:49 -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=CSkKLVTdxlSa3Cw3FnP5t9YpbHa3SOsFzZ2PlgCXSL8=; b=FjceO5g7bwheO9IaskHNfwXmtlsbLSvr6eWxeyp0VddV66kqYLRwJNE0TMXolRkXZd A5jCHaJETQWf11Hhk5ukOyQSGoL0vBLqZugZW4xbl+MGQCzkqc1x6DJ1JMTzNO01dfGx VYoxsNEAGz1pG70RFg8sKbF55c8AGPTTj67g4= 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=CSkKLVTdxlSa3Cw3FnP5t9YpbHa3SOsFzZ2PlgCXSL8=; b=jiVJ0mmfZZmRPnbWZ6eCtU1H+VjE2ji5Kd1LsKSzD0F70MAOCIpOTCmURPa5ri0V6l FL4nK7ch9nVeMAKKCJWuAYFQney9Fhle+atgpt68nD1gvQLt3kAidjV28BlajEtNyRJy VGc3xemzADy4SG7vStITqndIMikpGr631kOHoYF3L8u9JVbfBlN1fPiqnltWDKU6z4Ti CNvMzend/+opP2OnZfzMHKhGVXrhzdy8+orAPxB3QYUnyEHmw7UUydTgc67NXHfKjKnv uLzBF9fxfJF6u0TygbxEjDuuSE7hj8P1B9IaV1/T2vz3PY450EvS47wqkpBrlZ6Jhc7m 86vA== X-Gm-Message-State: ALKqPwc9Hc7rMfWRF91eztfMzG/x5wp7LTCwQFKi0HhNF3Cnr7q2697s T95mad1IHCi2ZsiLXqQk0Jdgag== X-Received: by 2002:a1c:c013:: with SMTP id q19-v6mr830906wmf.49.1526541409077; Thu, 17 May 2018 00:16:49 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:3dfa:be23:8db:bc2c]) by smtp.gmail.com with ESMTPSA id u89-v6sm7515428wma.4.2018.05.17.00.16.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 00:16:48 -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 v2] sched/rt: fix call to cpufreq_update_util Date: Thu, 17 May 2018 09:16:43 +0200 Message-Id: <1526541403-16380-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 --- - v2: - remove blank line kernel/sched/rt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 7aef6b4..a9f1119 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1000,9 +1000,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 +1285,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)