Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7953127pxb; Fri, 19 Feb 2021 03:48:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJywBgk2QWfpFIRWOwmCtluPw6+l+asZiIVcuLwO3sswUoBpdsDwJGTmwUSTQAbmJWnT8f4F X-Received: by 2002:a50:ee16:: with SMTP id g22mr9237622eds.235.1613735301901; Fri, 19 Feb 2021 03:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613735301; cv=none; d=google.com; s=arc-20160816; b=jLDL5fC+3VZDk2M0kMMCrOgPyXix8cfCOJMc8zVeZt+MFQti4mAkf2gQTREar/xv1S kiJqy+fQIuxiGvcwYqOdBJRCf3Nn+RVaY+vqYBZOmVzGN7Tw5ZgpDQ+R6ZxqGZD2vd1t rOoDKB8OiWnjzcYAxRnS2WDz5JamKENN5NYRPoENoRhHmWjwm5QU96yQ2nRwJ59h7B11 2LaSRle1NGEJbTYav9dH+tJV0d/QEX/hITYA1iB8V2l7r+jXd9nzqJW50+ygI22wYoFM jg9/on53HzuFQeR5c44AfcTtW7G+oJEqFIMwOyd+54/0U4QZFU9RIbs+nxxvaz5LsNF3 99fg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YbICSE48sPQjuRB7ng4DF/fEklSNJC/m6zyIx2m/MMI=; b=aX+S4Egwx1Qc3SvLntqNmZhhQrceSNrasBWjNjcRea7HOHgw7Rx0t6pSKsrwmnInvD kLS/jiGj/pCFquUXBzzsH5zvvFKAfoaJMl6uKmEaAxcSj92xmYqE43jyoj9MROU0tMoO d1rbAFUr/s/iD4/VvIgKew7Kr31w6dGo3MF9ApNUECzE9Z2r+Rj41A5xT9r/jJUth1Dw PK6PzQk7NTRvV2I2G0RN7KzyENGlyavAwas7PxuiFcHbJmxmlHBzIWtrh0KI3d740xEB /YnF3W7GzPGhkJKdyFCaQ4WN+i6khfnAuqOzYoB/sUAC25Xf9Stzxm4xzMiVCnUwSBtY EOCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O09bctQj; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si5265037edv.223.2021.02.19.03.47.56; Fri, 19 Feb 2021 03:48:21 -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=@gmail.com header.s=20161025 header.b=O09bctQj; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbhBSLqA (ORCPT + 99 others); Fri, 19 Feb 2021 06:46:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbhBSLp7 (ORCPT ); Fri, 19 Feb 2021 06:45:59 -0500 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A2AC061574; Fri, 19 Feb 2021 03:45:18 -0800 (PST) Received: by mail-pg1-x533.google.com with SMTP id a4so3912379pgc.11; Fri, 19 Feb 2021 03:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YbICSE48sPQjuRB7ng4DF/fEklSNJC/m6zyIx2m/MMI=; b=O09bctQjXyt54+aBzkFFgV558cKUXMsLMDm3XjAWmWB/UC4U1J3hpLu16aSJ7ORlE7 KNoKq4KNTtxGsu5C1o2IpWzRs/Wu5ibQh8cOvkbbGVJSDzUIr003TnfWWgb/gXk0oLX0 V5vFdAmjzvGTyKogv//XXANQIfX3AvNATGY7bDNUwOllCjJPTcY/2ZYQb7A3yAIu42Sc eKutlZMYOnmxcG2Trd5AIfSJorj34hYKtgd8YD+yZLh+FPG7Vqu5luKWVUczv6u60LOD HZk/wOvexCA9QbwcNFuMf10+Hgbq7olTRK4r3JIy64AzvPjpPHE5f75uTUtD22kjAQqa ZfGg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YbICSE48sPQjuRB7ng4DF/fEklSNJC/m6zyIx2m/MMI=; b=AMo4UtE49pI6clM0ej7goHNgqELYS0OwrZVZn6nQskxFCt/kamZB3H0XCKTNMAfjxT oLMMAQsw6wMKRsNO4aOOdJaL04fah1ZaZH8Qlh8bJmADHH6lM7rZNhjTx+ITufVJNwGd nCZKNmNdMzxrY+W9dTzkzcLnuK5b03RRnGh1v39O9M/IPMSlHaF/Nc7EEMPOEAqgfbfv Cj3IBSjsb0NJuspulQ6Q9DkBDUZAkJGKKjajQzrDqgvA8ZGgVwprYhyJj2INdxP63b1j iKhlIt2Hque2gBfilGNa3bqLzygdGlt/AglyvuDjCy0tji4HQt0y3FJ4IS3HAAPLXCEl KX0w== X-Gm-Message-State: AOAM5337mTBNM3GzLDGSiVY8pmsbHdyJVPZ4kaCvbAyI7X+mk79ooBu7 k0JFBD2WqU/O0SgPP7vELcs= X-Received: by 2002:a62:7f51:0:b029:1ec:dbe2:2c76 with SMTP id a78-20020a627f510000b02901ecdbe22c76mr8968620pfd.75.1613735118532; Fri, 19 Feb 2021 03:45:18 -0800 (PST) Received: from localhost ([103.220.76.197]) by smtp.gmail.com with ESMTPSA id c18sm3804231pfd.0.2021.02.19.03.45.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Feb 2021 03:45:18 -0800 (PST) Date: Fri, 19 Feb 2021 19:45:09 +0800 From: Yue Hu To: Viresh Kumar Cc: rjw@rjwysocki.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, huyue2@yulong.com, zbestahu@163.com Subject: Re: [PATCH] cpufreq: schedutil: Don't consider freq reduction to busy CPU if need_freq_update is set Message-ID: <20210219194509.00005884.zbestahu@gmail.com> In-Reply-To: <20210219093551.bykqhjk6xvs4kszi@vireshk-i7> References: <20210218082514.1437-1-zbestahu@gmail.com> <20210218102029.syj6vkltlbtoxsig@vireshk-i7> <20210219113804.00004a7e.zbestahu@gmail.com> <20210219040933.2o5hhbjb6emf3xl4@vireshk-i7> <20210219144140.00004de9.zbestahu@gmail.com> <20210219074249.2hcwcnakihor343h@vireshk-i7> <20210219162026.00002e2b.zbestahu@gmail.com> <20210219093551.bykqhjk6xvs4kszi@vireshk-i7> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Feb 2021 15:05:51 +0530 Viresh Kumar wrote: > On 19-02-21, 16:20, Yue Hu wrote: > > However, we will skip the update if need_freq_update is not set. > > Not really, we will update freq periodically nevertheless, around > every 10ms or something.. > > > And do the update if need_freq_update is set. > > Yeah, that breaks the periodic cycle to attend to some urgent request. > > > Note that there are unnecessary fast switch check and spin > > lock/unlock operations in freq skip path. > > Maybe, I am not sure. We are all up for optimizations if there are > any. We will set next_f to next_freq(previous freq) if next_f is reduced for busy CPU. Then the next sugov_update_next_freq() will check if next_freq matches next_f if need_freq_update is not set. Obviously, we will do nothing for the case. And The related check to fast_switch_enabled and raw_spin_{lock,unlock} operations are unnecessary. > > > If we consider unnecessary behaviors above, then we should return > > right away rather than continue to execute following code. > > As I said earlier, we may end up updating the frequency even if > need_freq_update is unset. >