Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp232829pxb; Wed, 24 Feb 2021 00:05:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6RMWh6eEUZbKh1SseJMFXIpGPR751QDH8RlaYdHNFxIkNaq4siszSQyhEZODMPNmlP4ju X-Received: by 2002:a17:906:128e:: with SMTP id k14mr29401308ejb.427.1614153955283; Wed, 24 Feb 2021 00:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614153955; cv=none; d=google.com; s=arc-20160816; b=D7icfiI8QR6Q21wESH+T8w/A9OeKubwaraCG6HNP4ND6cmfg3EtZkCncCbxF1VNsuX 3ACh/1J5jMIJ+bml6jm71tA3WuAqE1+FX2SanRjUiQ4S3KPzgu9p3Vz4r92A+ABWmu/Y TF3fnAQSk9PirsTDNR3Rv/3+qkebWQ5Dqy3SiUPuv/eHXBVI/8vI0B5OFIW9+f2nhqlP +FS009FiDkjkkQxMLKYvsqQSZJrS40gPTR9s8SBLUpV+TX6gj4paCb6rzxsrcpeGn0Ag mPsNvzOI4vt/pw3ck4dUyI4+b7BQxEFqlImci8Rby1LxM9Fa3WBO0ylr1EYyuNAFaO8u bj9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+PKX1tqPNykmedfrh7em0CF5LOPt6T508fmuoJN2TMc=; b=dCu8tLQPxUwNeXAUuxl1UqJLuC2vlNyGVDxnxG7Cs0FzlcPT1d8RhwHVc4Lva+3qpy o8SdiJl7F8wS9au/sLSibNZ9tbG3Ioi1Z3esv0qPG+Cn0BcW8VH5BolD6UdIAud/+2aA 2F2VWmJuvY3WHVHLgWNg9k31PL/5YMRP0kChMvJpTmXej+rPNn/h1ieODFuMkbMMB+Mt Qhyv/jr6ypQJl9JabM5GAxUGbi+36wt8807zXB8MKxsn6t2C/bPZAq1zrBBU6KAJDcjq Yvxh6n+6DLxzwZYBIft19/Dw/oXIzh2It2sN6aM3H/5w0giZ/YEO7n/hccIDuvhYjf66 YwUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CzUNH0mc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 i13si900180eje.417.2021.02.24.00.05.27; Wed, 24 Feb 2021 00:05:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=CzUNH0mc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S234248AbhBXGsN (ORCPT + 99 others); Wed, 24 Feb 2021 01:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234240AbhBXGsK (ORCPT ); Wed, 24 Feb 2021 01:48:10 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FFC8C06178A for ; Tue, 23 Feb 2021 22:47:30 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id k22so612558pll.6 for ; Tue, 23 Feb 2021 22:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+PKX1tqPNykmedfrh7em0CF5LOPt6T508fmuoJN2TMc=; b=CzUNH0mcsK2VYUb6BlIDTpdruzzV9hgZ7pzA3qwzBw9VL/+cDMcKHb0so0C+WULTDX z7mF1MrfVG8yEaqFUe6Zc6s/SVjdQMXoZkxFKZ/F0hZX8ME2jylYxx2UwHlhXkyvdlzU GPWsX8RzPqO/R3dOD0+NnEXa4lKOuUY9KHB8ADOhFdeJtNSxHRFq05Ek3Q2jhmHUICzr O27elcMSCW6Zhu0FVHfD2mah1v+U7JRuaH9raMMIK0Kbow4xk91qD+XkGqS+brli1hZ3 vIC2tfCfTeee3RKm7ocmz++EP5HHdzYepNVcdxtnYskiZDILRRLZzxX1NHWjv4Xz65uu TvlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+PKX1tqPNykmedfrh7em0CF5LOPt6T508fmuoJN2TMc=; b=VMZfcdJ3QQOtqhJnmIpkxKHIQ5ooZup/4b0O+R9Fg4IzMG23zoFN7EVs5ybzzIvWL7 mtqy8vcrw72zpSTmHBURPeZDhmU554wPZBgqPm3mE7GCG/WULoalx89iQELaAhr2IBf3 fZ48zLWKScx2T1J4U6CC/2vPA4pJo9+ZA973YUaBZkyJAuAzaoiSELB5bozd9I1NUsJR SIlKYhnnc0jPD/OCcA9Mcon0+5ThVcKQ/BlYj4n7MrCynazPisWYfuSy8247RQJIEv/S 2HgGXZcUX0Jq5arVBmDKVsfzyCDQjCqbL0Yf7WNtLH6yYAW5Rj/zufQFTSU8sIy2R1p6 PB8w== X-Gm-Message-State: AOAM532HOhIeJIY5G/jW+KRJZJ3peApZC8EDSgpT3XNn58u78H3wv2pz fiUVYIhpqD5/4eHryx94hq/K6g== X-Received: by 2002:a17:902:c702:b029:e3:cb6b:5e59 with SMTP id p2-20020a170902c702b02900e3cb6b5e59mr23521579plp.71.1614149249889; Tue, 23 Feb 2021 22:47:29 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id y202sm1455478pfb.153.2021.02.23.22.47.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Feb 2021 22:47:29 -0800 (PST) Date: Wed, 24 Feb 2021 12:17:27 +0530 From: Viresh Kumar To: Yue Hu Cc: rjw@rjwysocki.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, huyue2@yulong.com, zbestahu@163.com Subject: Re: [PATCH v2] cpufreq: schedutil: Call sugov_update_next_freq() before check to fast_switch_enabled Message-ID: <20210224064727.w3w4b66jnsmcxdff@vireshk-i7> References: <20210224063927.1298-1-zbestahu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210224063927.1298-1-zbestahu@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24-02-21, 14:39, Yue Hu wrote: > From: Yue Hu > > Note that sugov_update_next_freq() may return false, that means the > caller sugov_fast_switch() will do nothing except fast switch check. > > Similarly, sugov_deferred_update() also has unnecessary operations > of raw_spin_{lock,unlock} in sugov_update_single_freq() for that case. > > So, let's call sugov_update_next_freq() before the fast switch check > to avoid unnecessary behaviors above. Accordingly, update interface > definition to sugov_deferred_update() and remove sugov_fast_switch() > since we will call cpufreq_driver_fast_switch() directly instead. > > Signed-off-by: Yue Hu > --- > v2: remove sugov_fast_switch() and call cpufreq_driver_fast_switch() > directly instead, also update minor log message. > > kernel/sched/cpufreq_schedutil.c | 29 ++++++++++++----------------- > 1 file changed, 12 insertions(+), 17 deletions(-) Acked-by: Viresh Kumar -- viresh