From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3913C63777 for ; Tue, 24 Nov 2020 06:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 695352068D for ; Tue, 24 Nov 2020 06:26:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Xv/A2ULC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729693AbgKXG0Y (ORCPT ); Tue, 24 Nov 2020 01:26:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729304AbgKXG0Y (ORCPT ); Tue, 24 Nov 2020 01:26:24 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFEE3C0613CF for ; Mon, 23 Nov 2020 22:26:22 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id w16so4181297pga.9 for ; Mon, 23 Nov 2020 22:26:22 -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:mime-version :content-transfer-encoding; bh=jpZw9Iej76OYuUGFvM+oELcoTaKPmqjpkVWxqorKfuc=; b=Xv/A2ULC/Ok9WfCZGQKExT+MDpPlNLIiKoRnayVzlu5cJ9+f2QTMIQZh4TnuwxFzCj qMWHnMM37/b/MLGm0vSq7k9REQu9iRjh3AXlKd52WgXmjc8VgkMsdXvKStaqQ/4f9zCv IhqMvmnE9Ue1kqDasiSEqMkCNS0MwJSml2pKbD9Wx7cTAGKeUST2X/6HQ/cX2o5upzwe SKsSkeY3ag3dK/LgL33C3ubxgkLxNcpXmpIf3QClddFEcDLwPHSz6XolWRhUMJK3JboD 0AL3TrMPc74lGa7wRwncbdL1iltJFDxhaa3Q9Esi0OyDPdbeKXCfEGE/q5HQbjLjS54J ZrJg== 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=jpZw9Iej76OYuUGFvM+oELcoTaKPmqjpkVWxqorKfuc=; b=U/tsD98bXwFTXtuNoIzcOzI7fZh7bcW4B8TxI9pmkF3PmgweIm9hBKAhf6ZwXcxGOs 1Xxv7ThCc4Hb0wy1qwipfgXlIbJ5FgrYU/feGKdrw2g4yrE91rz9iku/Oe5uacuYcIvU bPAuEwtyZQ7N6kI/wJkNQx5Y5uADY9RSUkE+T+MKQEjLabPSdHTGwNri2RQvh7XUk0R7 mOlB1f1B+w/N5X42fzhrr5ZHM2svz7mK/U3MDIJL0VZLdVTvLSr/tbKWHcXZku/KTBGI X2vMYaVdwdNfndeoYxJS0K38KhzJa57qbAgALv+qWl9CDwQNFSkhIMa3GKMyUKU46D79 x39Q== X-Gm-Message-State: AOAM530ptFiUajGQPRcpoElvU3N86PfbgkD5eSG6QZD1L/v9gcRCgMAH hnvMyRFNDpFHtVKEe4syC5ETDw== X-Google-Smtp-Source: ABdhPJzSE6Krloh3zuTDK0TQPefXqGY3SdvFhb05zcIkKe8FZifbiRpzKRKf1hWkLPX/0GznUt8NMA== X-Received: by 2002:a63:4765:: with SMTP id w37mr2537452pgk.332.1606199182233; Mon, 23 Nov 2020 22:26:22 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id 67sm4436226pfz.96.2020.11.23.22.26.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Nov 2020 22:26:21 -0800 (PST) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Amit Daniel Kachhap , Amit Kucheria , Ben Segall , Daniel Bristot de Oliveira , Daniel Lezcano , Dietmar Eggemann , Javi Merino , Juri Lelli , Mel Gorman , "Rafael J. Wysocki" , Steven Rostedt , Viresh Kumar , Zhang Rui Cc: linux-kernel@vger.kernel.org, Quentin Perret , Lukasz Luba , linux-pm@vger.kernel.org Subject: [PATCH V4 0/3] cpufreq_cooling: Get effective CPU utilization from scheduler Date: Tue, 24 Nov 2020 11:56:13 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patchset makes the cpufreq_cooling driver reuse the CPU utilization metric provided by the scheduler instead of depending on idle and busy times of a CPU, which aren't that accurate to measure the busyness of a CPU for the next cycle. More details can be seen in the commit log of patch 2/2. V3->V4: - Broke the first patch into two parts and used effective_cpu_util() in schedutil (Rafael). - Removed comment about idle-injection in last patch based on feedback from Lukasz and added hi Reviewed-by tag. V2->V3: - Put the scheduler helpers within ifdef CONFIG_SMP. - Keep both SMP and !SMP implementations in the cpufreq_cooling driver. - Improved commit log with testing related information. -- Viresh Viresh Kumar (3): sched/core: Move schedutil_cpu_util() to core.c sched/core: Rename schedutil_cpu_util() and allow rest of the kernel to use it thermal: cpufreq_cooling: Reuse sched_cpu_util() for SMP platforms drivers/thermal/cpufreq_cooling.c | 68 ++++++++++++++---- include/linux/sched.h | 21 ++++++ kernel/sched/core.c | 115 ++++++++++++++++++++++++++++++ kernel/sched/cpufreq_schedutil.c | 108 +--------------------------- kernel/sched/fair.c | 6 +- kernel/sched/sched.h | 31 +------- 6 files changed, 197 insertions(+), 152 deletions(-) base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec -- 2.25.0.rc1.19.g042ed3e048af