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 7F73BC4361B for ; Tue, 8 Dec 2020 04:18:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E7AA23A61 for ; Tue, 8 Dec 2020 04:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726292AbgLHERo (ORCPT ); Mon, 7 Dec 2020 23:17:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgLHERo (ORCPT ); Mon, 7 Dec 2020 23:17:44 -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 E9EAEC0613D6 for ; Mon, 7 Dec 2020 20:17:03 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id w6so12634640pfu.1 for ; Mon, 07 Dec 2020 20:17:03 -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=QHdvJA2HTSsKcq12ECvAFT6hATkrl/TFzJg0uMaRku0=; b=YKPk34UO6uwnipQNlIBKtdQw/9xGkncAFiZryxzvH34O/VEGjEaYwyr3zstJRQ23yy 2d6nIPyAZaPz21F5m+W7/O9qXIU0UQjDz2ncZzh2LBOlfEHAKFTGEVYcOnI+a7Zxd7ax dbsoZwoatQouMGQaIftlSidpryFdaeILezrvQeIjFP8uIdffKQJKbpbIURf3dHOM0MtH 0RyLIMvZkHvvRLFth5i+QTQbJPkxe8zkdskTn6ptpRb7DjXH/VJq0vsbf+bNOsM1qP2M Fn8f968ZMyDnvZ/3Itqt4GKht5ji6dSFw/F4MNLEGV+E7bIybyrDipAGSf26A4Kcq5ph g5QQ== 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=QHdvJA2HTSsKcq12ECvAFT6hATkrl/TFzJg0uMaRku0=; b=Tkc5BV+EVd06MsBz1kV1UyXhtgkfaip/sEFo+dl0yQsCsHfdLi7hdfd1ZVwJU1PZaD GWex1vAtIOccfdX7oQzZBWjLeQgXX5heEn9uSzPOHxWo59v1L5EQuDpaRxhEJngziM4M Cj0edpeDVC02/Y1Zy+TBAwFPjm7sBpu7++tPf9mrggiGNKOx6VGwS8KAOEQv2iAoJkp8 Dplcq2qhRWWHpEn6xOMgkBmK8HwvOwygok1d8SHgQ0jPt5SVFxv4bdhj08GWx+VQs3az ESdMp/wKCIloY5yLV6nt1U8Fu+DQod06ida0EJFxv0xkLCPRezUIg+s8CfSpWx+mJsWU VhzQ== X-Gm-Message-State: AOAM531bJkFHUV7B78+Ixop4snXdzx1x6cVjVZx2w8FSBhfnA2bkL3zj nKbGA9fXNyajo0+YU/gVPrwHyQ== X-Google-Smtp-Source: ABdhPJwJUzPaDCBiYEYyn3tMURt2qiGQGs2mL3byq2uqzBnMc5ig1jS6M6TLGHIYPgvzT9y5ea3XhA== X-Received: by 2002:aa7:9afb:0:b029:19e:45d8:b102 with SMTP id y27-20020aa79afb0000b029019e45d8b102mr3130288pfp.48.1607401023135; Mon, 07 Dec 2020 20:17:03 -0800 (PST) Received: from localhost ([122.172.136.109]) by smtp.gmail.com with ESMTPSA id w9sm13052748pfj.128.2020.12.07.20.17.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2020 20:17:02 -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, "Rafael J. Wysocki" Subject: [PATCH V5 0/3] cpufreq_cooling: Get effective CPU utilization from scheduler Date: Tue, 8 Dec 2020 09:46:54 +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 logs of the patches. V4->V5: - Don't export enum cpu_util_type and don't pass it as argument to sched_cpu_util(). - Fixed a build issue with !CONFIG_THERMAL_GOV_POWER_ALLOCATOR by moving {allocate|free}_idle_time() out of CONFIG_THERMAL_GOV_POWER_ALLOCATOR in patch 3/3. - Applied Acks from Rafael. 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 | 69 ++++++++++++++---- include/linux/sched.h | 5 ++ kernel/sched/core.c | 114 ++++++++++++++++++++++++++++++ kernel/sched/cpufreq_schedutil.c | 108 +--------------------------- kernel/sched/fair.c | 6 +- kernel/sched/sched.h | 22 ++---- 6 files changed, 184 insertions(+), 140 deletions(-) base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec -- 2.25.0.rc1.19.g042ed3e048af