From patchwork Thu Nov 19 07:38:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 328393 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp131218ejb; Wed, 18 Nov 2020 23:39:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3bwg+U1x3h+Ey8pBE4ttHXO9HqJXw4K2uhfRS4QsaT525UrKBnfezfYqhtfih/MSavGDS X-Received: by 2002:a05:6402:12c8:: with SMTP id k8mr9651809edx.192.1605771568064; Wed, 18 Nov 2020 23:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605771568; cv=none; d=google.com; s=arc-20160816; b=R1+p6/CHUQGLokRxYez+UDVhDx5yDSsHHgY8WU28NxhxkP3IjNScJWtdY+yRSOsomc qcESrxGN9KoQJ+dYO/tNzQ+AvSBlhKqHXDIKxvw9dZqvTLOJTi87JExx/Zt1JntBGkFw KOe81wyl8+6URTTwZEuv0AIi0qkebbfk0LiNindwN6EEUOAxCZ0yCJb57Pbs50MCNF6V jwRqigyf3o8atrKZ3oVe8/rv8HwNfvDs2rU7TEa5Act3wg8TGMvCBwj5mxVQI+1pCork Krs6emQDQZpHUeDGOj3xcwTK2QyvNaErMla7XZLQyZr9BCSlQ6lX9qpBSfEgm4DSmM1B UApA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FluejX8Dzg1crQFPmryHIf3eruZYIbY+9wYWfggNbDk=; b=NVXu47vnjLBrq3xZp5mUpGlP+ic5FgFhARjNB9RnHJWg3MpYexhX6wZXtCK3mV2LfV WRrsqjx1ym8qDJPHG0aYpLBkWV4Sxvv+2B3HkwxbQAnB9CJqFn0UBIO8wq/SyQvMlkd9 k4dCwB8ZCzVuftehX0xhr3MN+xta005S3L5Ir2Rg0oeP1VsnIhAVSedTIOgVNGDyYzfz LQk9o65XN23MEob+7FnkU2NcOhMkXYGS0w/jq4SekCe3IWMNKDyxgkEuS7d5jmG5slSC 4UyGHz5gXq4cZvTMVUQ+i7nXR7+H6sSx8DeX596N0kIdkn4ZaBjXKKa9YRPyGRSd99zX rCAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R+PKQ/gQ"; 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 oo20si2765966ejb.400.2020.11.18.23.39.27; Wed, 18 Nov 2020 23:39:28 -0800 (PST) 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="R+PKQ/gQ"; 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 S1726305AbgKSHiS (ORCPT + 8 others); Thu, 19 Nov 2020 02:38:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgKSHiS (ORCPT ); Thu, 19 Nov 2020 02:38:18 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841D7C0613CF for ; Wed, 18 Nov 2020 23:38:18 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id t8so3627820pfg.8 for ; Wed, 18 Nov 2020 23:38:18 -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=FluejX8Dzg1crQFPmryHIf3eruZYIbY+9wYWfggNbDk=; b=R+PKQ/gQiv0Raup9wfMhvJuZUps0i5f08XvP3gEi98krbmQPwGTWpjyezyEUwEinUr l17G6Qo3rL8fLQZ7CwvyKGCWZRVRLbPvNJ/W4lh56pQeveLEYYxMhxvzudUHiTiuijzg kc6ft3pwwyzimQ3B5KAQK1tgmya01imagxSXh7Ig0njJlXo7A5r8cfiEh4or8JlX58Ig vP0FSxqIxqvfCXM01d2gfx4MGajzsA8JpiMozb+3X5cD1pp+jpBD5Sv9ZrF1og71SHWI O65aaGx0UHPBUso8qZlr/6CIqKe8s8Dnw24vVGQZ1FNGDrMxbMP8cWWf1Pdb3y1IhNn+ B8BQ== 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=FluejX8Dzg1crQFPmryHIf3eruZYIbY+9wYWfggNbDk=; b=eWS/yNf8aIC4wVswJnfjCBuWI5ViStw9/lIjA4PbC2prEAiyI/sHKZvIURtn9DSQAJ OczGXSYauD67n//ZFtnEeoV1AMW9tiAv4pQT5BuAWM4BjXWBcHj2ZUFqgoB/n6C3ilwM 8MeH67GIT8bhm1IK5C/nIGso36/ewQ5LQ0cwqnSU73BFIfVqN5IclU+fGrZc8xVKnNHx 99Z8L+QAjnOarbpZkVGFYDGqzBT1wGHpvTJMPxHl7cWqsH8ncZWxAwEcsuvY8Rm8E+eK OEpZJBvQvVY7kb2aEKNd9eUuYFSMa9oybhGnbMLDegioUr2HoZoQUZ3KgqCu2iqIob3z r4ZQ== X-Gm-Message-State: AOAM530xItxxCbGW6jHICwuUn7o5A6WB+CY9WxIoeDgTNEk+loVJ4CA8 5ovoStB4RTDI8lQ9KIuudxYFFuLHcORqrg== X-Received: by 2002:a17:90a:ae14:: with SMTP id t20mr3129691pjq.13.1605771498037; Wed, 18 Nov 2020 23:38:18 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id 35sm22559004pgp.26.2020.11.18.23.38.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2020 23:38:17 -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 V3 0/2] cpufreq_cooling: Get effective CPU utilization from scheduler Date: Thu, 19 Nov 2020 13:08:06 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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. 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 (2): sched/core: Rename and move schedutil_cpu_util() to core.c 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 | 116 +----------------------------- kernel/sched/fair.c | 6 +- kernel/sched/sched.h | 31 +------- 6 files changed, 199 insertions(+), 158 deletions(-) base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec -- 2.25.0.rc1.19.g042ed3e048af