From patchwork Tue Jul 14 06:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 235503 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3477013ilg; Mon, 13 Jul 2020 23:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxekGc7h5VOAxDVc3XGjZT/Gun2b/sqEToInBv1UnQAyDP44YpVgo9YXH4TRmnOYHYsgzZN X-Received: by 2002:a05:6402:543:: with SMTP id i3mr2872333edx.182.1594708622164; Mon, 13 Jul 2020 23:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594708622; cv=none; d=google.com; s=arc-20160816; b=eeZ0FfxZRfOQwfHG9+paRlKKHIq5pX4WKLr26oy9BN2pWAHK/b/E+Yy9A82RC1FGHI hQPU1WgQcEiDetKCC/9N/CafKS2z9CguCNHirfM8APAP9o2iokO6KzKIkvGP9PDmSs40 Hl7aLgSDVAXCOsGsC5nBrlO3rac7QHrHktjJXaKUmWgV4YLay0/A+Vrt7AqsujmK7F+f MTBs/pv9Gz4Lrq+VS4BGmt2lfHNg2Rd+HMsTJPivTpAya3w3WqaR4TLnaE2C2ky+7qGy FZ6OtFYgQwpJJ9GqNYWMGHDBUcxjAHpAf2fEpZB91qmFLPRL5wqyrvu5G9OxoMo/ccsn /36g== 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:dkim-signature; bh=CbfKQREcoHPRf158XU0NW9idW+wBMzJwoASt/jMG48E=; b=yTRTOzxwf/P5H9P+hI9jGjZloWZbMtkGiutbL4Vo8uamyiEDW6H+OxyiIfUV+HMjMa Sv/JSqs9PfOGBkfqPjB7euzgZkb/WKzccRWeUj1U9reR1QUCo/AbQ9rJU/7av+Q3Gyxd pq+IJj2FVwD6d8FItMBHTRFIf2ZnFACNsKKoa5HJSXWd11gDl5EdcFQCf13m8Oe4pscp Yk/XnolbIzXlK975/hyxELtZ2A3yz96ew2RF5z7Ta5faTL1MxVadR1a1B2a5kX6vzBQf +PYpQQcJVOyXdFbs76+5Pu+ptCfEOpZdh62lM/YkuJ7RVy4JpRNgx+Mywwb8L9tkWd4c NBbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U1CHUpPV; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c27si2994339edj.262.2020.07.13.23.37.01; Mon, 13 Jul 2020 23:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U1CHUpPV; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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 S1727052AbgGNGhB (ORCPT + 10 others); Tue, 14 Jul 2020 02:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbgGNGg7 (ORCPT ); Tue, 14 Jul 2020 02:36:59 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB84FC061755 for ; Mon, 13 Jul 2020 23:36:59 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id x8so6607153plm.10 for ; Mon, 13 Jul 2020 23:36:59 -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:mime-version :content-transfer-encoding; bh=CbfKQREcoHPRf158XU0NW9idW+wBMzJwoASt/jMG48E=; b=U1CHUpPVALPCRm2GeeE0rAYNmIhgWuHt4IhvISlOf8IAmDCGM8f5XPKotEJJmnprrJ Gf+fbSf4vE2f/VJLVuwGqMIv++0tp6II899RIQdLpsan1vymqNP6niU1LD03GxnJ5TsE CMEFdAGK8MuDYIFYbf0LhBWxS2pnjA/bJ/HxMzuvotRHKNwtAKE1qISErPzQUDmdPSTx yk8BmtwaDya8LgEl2cdyRkblidtvRQELBQhdpE6RbXQ1z1rbpWtTHpDwF1S2Rrkhu2Tv B5oXH0yaeb9zdpEUTZGUHnJS/GIUVIyDd6BdPJdXfQmk6ldTsrZ6CgMimeHojAdrS/k7 /vVw== 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:mime-version :content-transfer-encoding; bh=CbfKQREcoHPRf158XU0NW9idW+wBMzJwoASt/jMG48E=; b=qs7ArFjnTM0jQd9YlH02wyx54Oc1PAE4njTmzT/a6V16G4yC5zCYPLtTnBO7X0On9y h6QPgxxJgI7CMVUs70hv40fpI68QMaU3skmdg32XEcHMrVfjvzXGlE34P6GNK4FTo6B+ IYCFHu4FIoFHFs6zLuGiAkiGLh6eTLG2iQjBiRsc7P2MmGc86zIw1NcywjP0VrM/rUu2 wa7BuHQ/2nX3Y9x3wa+OQ/HvT6mjZN9pEKf8AnuFwBeTCTzsh2YQtnybgSP3J5w+43FA krLAycQ4qqr03PgavV5+Pss9umaTcIfVqMZ0MM2I0XFl/1EH+HsJpdrTu5JzeR6XLF/1 alpQ== X-Gm-Message-State: AOAM533F3AAuXVmbSKqSkiqxJ8ok9a5UgWaF9E5HD7msOXYM3og+xGx/ WdJkbANQX5iGr4A5EoocHj4GjA== X-Received: by 2002:a17:902:e9d2:: with SMTP id 18mr2739643plk.40.1594708619207; Mon, 13 Jul 2020 23:36:59 -0700 (PDT) Received: from localhost ([122.172.34.142]) by smtp.gmail.com with ESMTPSA id y17sm16080185pfe.30.2020.07.13.23.36.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2020 23:36:57 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Zhang Rui , Daniel Lezcano , Amit Daniel Kachhap , Amit Kucheria , Ben Segall , Dietmar Eggemann , Javi Merino , Juri Lelli , Mel Gorman , "Rafael J. Wysocki" , Steven Rostedt , Viresh Kumar Cc: linux-kernel@vger.kernel.org, Quentin Perret , linux-pm@vger.kernel.org Subject: [PATCH 0/2] cpufreq_cooling: Get effective CPU utilization from scheduler Date: Tue, 14 Jul 2020 12:06:51 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, Schedutil and fair.c use schedutil_cpu_util() currently to get an idea of how busy a CPU is. Do the same for cpufreq_cooling which uses CPU's idle time currently to get load, which is used to calculate the current power consumption of the CPUs. Tested with hackbench and sysbench on Hikey (octa-core SMP) and no regression was observed. -- Viresh Viresh Kumar (2): sched/core: Rename and move schedutil_cpu_util to core.c thermal: cpufreq_cooling: Reuse effective_cpu_util() drivers/thermal/cpufreq_cooling.c | 65 +++++------------- kernel/sched/core.c | 106 +++++++++++++++++++++++++++++ kernel/sched/cpufreq_schedutil.c | 108 +----------------------------- kernel/sched/fair.c | 6 +- kernel/sched/sched.h | 20 ++---- 5 files changed, 130 insertions(+), 175 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af