From patchwork Wed Dec 13 09:53:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 121726 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5255712qgn; Wed, 13 Dec 2017 01:53:32 -0800 (PST) X-Google-Smtp-Source: ACJfBougUIP5Q7qLysvxEfTWwYrlQq1RsaGMaJr1MTViXhjnmYWLOWTR4OVU5oae4NB5Y7Z0fqkP X-Received: by 10.159.241.1 with SMTP id q1mr5393551plr.383.1513158811962; Wed, 13 Dec 2017 01:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513158811; cv=none; d=google.com; s=arc-20160816; b=EixbZXedt7RhHI75lGXzZtfRC/7Sjj1TcEyhdNtR9ptMnEE1xwAhxYpGCQRPNWJSkp TDvTkenEtI62q11yUAPLYf8JEBgnwoYvI7UiTOVZ9CvqUz5uMzsIWIWPmjWp/ZtJb3sD 4/2TZoUHcfqnuozdPh9no7EfRGrleMFUglq61j74kh9b7zZN3BD89AS9ee0RQuRXE2wN ugPASSaN2lMeCukhy1XQ0W0/ArrwivK6HJI+/brJ1m+m6oL06cMZYhVLlpZ5SbXHuSjT E3ZDO62i2+Vej8au8jriTGPcw8O8aptWEnbu8D0szf+E95zLFiUIWTsgS/9AsMPGrCPC YOTA== 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=0Iq3LILX9r19PBTb2RbNbu1VmaMCmY071z0gjsFcmIc=; b=b/aRnTZENFQHTRU+0YLDLwNLdwIWxTmm4IcyKohAPgkiKiXqnp+tSANsxx3OW3Gz5P SMUT/CvdePnHuyBBsltRhkc4O9IJz1j7Fksnvs7vvlDVRYlZOjeqLH/lcKX13zYFYQ9F oiLiFb+SYqprV4VRLXeTYelhqc2dUWmrei6HdCScluxOmxgGGrO2dEm446ouBN602XIj Mp7FYpFvXNJne74VF8hKyH/CcP5tQPSlm5huTY3z/bmoEVLFAyuHAaJpsZvJ4cIbfCoD 1a0rnA/RoF+9WbIWUCZ7dBfPg0hpHLat8pR5HAM5Vheji7536a/NhiHiaQi7MXjXB7Gk m7eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZN6ZU1+h; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 f5si1020951pgn.183.2017.12.13.01.53.31; Wed, 13 Dec 2017 01:53:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=ZN6ZU1+h; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1751507AbdLMJxa (ORCPT + 11 others); Wed, 13 Dec 2017 04:53:30 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:45635 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbdLMJx2 (ORCPT ); Wed, 13 Dec 2017 04:53:28 -0500 Received: by mail-pl0-f68.google.com with SMTP id o2so696831plk.12 for ; Wed, 13 Dec 2017 01:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0Iq3LILX9r19PBTb2RbNbu1VmaMCmY071z0gjsFcmIc=; b=ZN6ZU1+hRR3HVSr0YmDxiXfz22SJgrFHGv5A3bSCZlP3OgDns4YBTEsaUd/ao/xzCO U29bLwglABe4qFnWMWqL+VEArwQtIbkB1T2QFhBsXnN16vVMPDOHnoU90iq0ZoEsS0/A ufh0Kpy6G3dLB+0rthb7xXcmdM3m5/EQc052U= 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=0Iq3LILX9r19PBTb2RbNbu1VmaMCmY071z0gjsFcmIc=; b=nVdAsEN0eYkt5IXDNhiX3M9DoQyomKSnCPZ2STG87P7NxMiF/QW27l/PZFSXoIiUsq wFvdM8kWHzyHKflaxqgG6LP2684Er+GuvJqGThK7y7OqUrPnTNQFOdrs6f+ADOzXEpu2 DHofn8Dt+MkT9u8hBR+y9Y2upo5KNY5rKRTqH04hQIdF2bTjlkST5E/f9zd7OeBnZGoE hvx7Cu0nK0D9SDlMFPOBpRqVJAwFVq038us9zLGYR0mzN2WPBuZaSPCwNWO5+BWHBdCe YyRYea1H8OoMCsTQkyMsm8FY9seNNodyuecfsInG+YFMW7KzA02d4C5C0bDR6jT37NoD DhWg== X-Gm-Message-State: AKGB3mITuhhadoM2pLBHSs/kEKGHq8eE5Dh2SZL2eZ3JzWsjZ6D6IFIY nv5384IOOSau6/S/bCsFfOwbUA== X-Received: by 10.159.204.139 with SMTP id t11mr5345780plo.24.1513158807966; Wed, 13 Dec 2017 01:53:27 -0800 (PST) Received: from localhost ([122.172.99.7]) by smtp.gmail.com with ESMTPSA id a87sm2506398pfg.159.2017.12.13.01.53.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 01:53:27 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , dietmar.eggemann@arm.com, morten.rasmussen@arm.com, juri.lelli@redhat.com, tkjos@android.com, joelaf@google.com, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] sched: cpufreq: Track util update flags Date: Wed, 13 Dec 2017 15:23:19 +0530 Message-Id: X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, Currently the schedutil governor overwrites the sg_cpu->flags field on every call to the utilization handler. It was pretty good as the initial implementation of utilization handlers, there are several drawbacks though. The biggest drawback is that the sg_cpu->flags field doesn't always represent the correct type of tasks that are enqueued on a CPU's rq. For example, if a fair task is enqueued while a RT or DL task is running, we will overwrite the flags with value 0 and that may take the CPU to lower OPPs unintentionally. There can be other corner cases as well which we aren't aware of currently. This patchset tries to solve these problems by taking a different approach than overwriting flags, i.e. set and reset them. The second patch does that transition, other three patches are minor optimizations here and there, but related to this work. Tested these on hikey620 with cyclictest, perf-pipe, hackbench and ebizzy and no obvious regressions were seen. Based over linux-next/master (as I wanted both tip/master and pm/linux-next). -- viresh Viresh Kumar (4): cpufreq: schedutil: Initialize sg_cpu->flags to 0 sched: cpufreq: Keep track of cpufreq utilization update flags cpufreq: schedutil: Don't pass flags to sugov_set_iowait_boost() cpufreq: schedutil: Don't call sugov_get_util() unnecessarily include/linux/sched/cpufreq.h | 7 ++++++- kernel/sched/cpufreq_schedutil.c | 36 +++++++++++++++++++++++++----------- kernel/sched/deadline.c | 4 ++++ kernel/sched/fair.c | 8 ++++++-- kernel/sched/rt.c | 4 ++++ 5 files changed, 45 insertions(+), 14 deletions(-) -- 2.15.0.194.g9af6a3dea062