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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 13AA4C433E1 for ; Tue, 14 Jul 2020 08:24:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E630721897 for ; Tue, 14 Jul 2020 08:24:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="D+se2QTE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbgGNIYK (ORCPT ); Tue, 14 Jul 2020 04:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgGNIYJ (ORCPT ); Tue, 14 Jul 2020 04:24:09 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044EDC061755; Tue, 14 Jul 2020 01:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NTXTDSxXIabpTtQm/KBGD+7vkhm9AF9uI5qymKFrD1w=; b=D+se2QTEccQm3Ggm33suL8k8ez e8uPxBkYvNfxWeFq95mKwbbpEU9WSrnr8JNTxU0ueYEw5bm+xA/r0BUDOUlxInDMjd0BiojA71AyX QPJ8pT10mSqJLKhMw7M+X0Bm+XrnzwYB2UKx5rnbUMmzi2d5mQ4XhzIERPlGuuK2E/l76p6xU+20b 84/4zOfGHB8NXjGHmtu/rSRQRYtz0NKTxqONHWQkKuUk2fEG9sMgeRmPh/saiW1XyYveOYeFCnRay RLDJgcNxnIFRACLiYRer7WOpwsVF/g3gFZaJw1P3EUod3kRwXbArN+M7Q8UCwrG0J674qsp2zRcQp B4AD0qvw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvGEH-0003WO-Ek; Tue, 14 Jul 2020 08:23:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D5D7F302753; Tue, 14 Jul 2020 10:23:52 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 405D02141F06E; Tue, 14 Jul 2020 10:23:52 +0200 (CEST) Date: Tue, 14 Jul 2020 10:23:52 +0200 From: Peter Zijlstra To: Viresh Kumar Cc: Ingo Molnar , Vincent Guittot , Zhang Rui , Daniel Lezcano , Amit Daniel Kachhap , Javi Merino , Amit Kucheria , linux-kernel@vger.kernel.org, Quentin Perret , Rafael Wysocki , linux-pm@vger.kernel.org Subject: Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util() Message-ID: <20200714082352.GN10769@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 12:06:53PM +0530, Viresh Kumar wrote: > Several parts of the kernel are already using the effective CPU > utilization to get the current load on the CPU, do the same here instead > of depending on the idle time of the CPU, which isn't that accurate > comparatively. > > Note that, this (and CPU frequency scaling in general) doesn't work that > well with idle injection as that is done from rt threads and is counted > as load while it tries to do quite the opposite. That should be solved > separately though. > > Signed-off-by: Viresh Kumar > --- > drivers/thermal/cpufreq_cooling.c | 65 +++++++------------------------ > 1 file changed, 15 insertions(+), 50 deletions(-) > > diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c > index 6c0e1b053126..74340b2b0da7 100644 > --- a/drivers/thermal/cpufreq_cooling.c > +++ b/drivers/thermal/cpufreq_cooling.c > @@ -23,6 +23,7 @@ > #include > > #include > +#include "../../kernel/sched/sched.h" Hard NAK on that. Just writing it should've been a clue.