Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1396118pxu; Fri, 16 Oct 2020 10:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7oEkZha0CEmaPRn1GJ68e7i2xGgjx/b9ibDAzVsr66PafTxDACkURdRwBbP1j7f71mhbx X-Received: by 2002:a17:906:da08:: with SMTP id fi8mr4890787ejb.375.1602870710776; Fri, 16 Oct 2020 10:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602870710; cv=none; d=google.com; s=arc-20160816; b=pcTWfybLTmUZ6YqLCJ7CMbrsZ/dbXmAr+wGbIvIeoIHuAQUeT15nLTZesDKaoj1y7a ZXVQ/3rMXpcF6U1nMtBLQLRJZXCqDLG9GrwsoQ1bLtHCgPIMTumx6sLfq32jEncnbGDp hUMsHAIhjidDrYwfZXSMcLYez0og0uL38JfurV/VQJ2O3qsabQ6056D7a6WGz0WjKJDk OFAfMj0sy5vWKu7iE+u8iXUyPaM0mES8WIw6Jp+nvng0A0a8s3QlkG4lVYaVcT8+xZH0 QgWn/upL3Hi7dNElLzbWoccxpdM8IHSRmojkTWwr/fMK577DVgaOxrV7tiGcr0IEKQJx dkgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zENxSAeGKbpBnEX6rPV0TIBwim48VlxqhCDWWJ45340=; b=xWE2CeeT92WmSNM9w21dDq9d7iuZnXUX1Ht99uLQeTpqECh14fAYreu2R/b61R/k5d ZLML8DgFLyl77QZZbJc8FCpFEC3c+aJs/BRZZRnzNqohj4eqMFTqxx9PB4XESxFzCbfb v7fSBOBgXKxNg3fnfawcO03AbTOY+VS26XiSI+dc6579Q6uOi1DGLsvHK/TzUJkbCEK2 HfvRlnn1WdjmcKqdcOheIsIblzwVBoEZnr1ISZa/ZIYYCa3S9Qc9YeRPKV/D3NceZSvN 6YNw6nGIWq5sMsOZmqzQvP02RrEDk7ZK3DsiUlWzoMGrTdqDJYlOVX9WelCFJLpT3Lhf fqCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KbnasV8w; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si2086817eje.315.2020.10.16.10.51.27; Fri, 16 Oct 2020 10:51:50 -0700 (PDT) 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=@google.com header.s=20161025 header.b=KbnasV8w; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732272AbgJPRs5 (ORCPT + 99 others); Fri, 16 Oct 2020 13:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731589AbgJPRsz (ORCPT ); Fri, 16 Oct 2020 13:48:55 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E201C061755 for ; Fri, 16 Oct 2020 10:48:55 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id a3so4342200ejy.11 for ; Fri, 16 Oct 2020 10:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zENxSAeGKbpBnEX6rPV0TIBwim48VlxqhCDWWJ45340=; b=KbnasV8wlhnzpfAjJOGWYrKSUXRjEXVMc6NIUg6+i4B+1iAmCYXqt/l1oNakb7OGl3 uJ7JEXtaL22zXDNAXEMRRkN4eRQCACMROFEHF8QpoR/6BKFr8srRjgrMvcXbRt9tClZX HxO72oLQhXbxkTUAIzy6ZwB9yPTeJrL+e0MgKsfgsw0KwfZbC0/UK72ptfByd9QjZ5QN OsvKmH5CWlsD2x26Erx3ofnvWiVBT7/7aLc17fHjv/ecF/VaGA8UvVQqtENqF37G3sGM 3P7SiDSSx468C3MSnilSRAVhhy33Ok/sRHP/iUyc/qEfjZ2bX/Mhl62DbDF7wzCh0Czm dccA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zENxSAeGKbpBnEX6rPV0TIBwim48VlxqhCDWWJ45340=; b=G9ltk2S0WFPTsaQ24YneesmzvVnLpAPUY14i4j3BA2OUSUdte6Gxr+ETIZu9w6OSgY y62uldvA2KuypBLLa07VXvcWCTNIwXXBZk+2Guw9AIEzPE+NYswhF3rIJTmDOO18561U N8p9l978uOJf8cWxKz5Ij6B6Z17OwOwCQBQVOHIB7HR63jMihqpZfIv6tbId91enrryN aE+KHB/K0qt3jAKyvqyicMu/U2R6/1UDwg3vy6o2y9RhddKI68AHUwYucMNtwTip9UTB wyfGnYJ+m72a52kKJ5rpA+4YJkYcQsjcTXdGlz7NwejADM91+RZQ3SGb65ELh7d0LPEF YZMQ== X-Gm-Message-State: AOAM531bAg97lcO+xwzfQxRcuXkNIWF+wcoYx5zN560CpsrGEoH87JI+ XhBYSKXwpiGBIFD8MUmwNPETpjVQ/CTWQ9U/mJAq3g== X-Received: by 2002:a17:906:364f:: with SMTP id r15mr4909815ejb.388.1602870533554; Fri, 16 Oct 2020 10:48:53 -0700 (PDT) MIME-Version: 1.0 References: <20201016163634.857573-1-wvw@google.com> In-Reply-To: From: Wei Wang Date: Fri, 16 Oct 2020 10:48:42 -0700 Message-ID: Subject: Re: [PATCH] sched: cpufreq_schedutil: maintain raw cache when next_f is not changed To: "Rafael J. Wysocki" Cc: Wei Wang , Viresh Kumar , Quentin Perret , "Rafael J. Wysocki" , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 16, 2020 at 10:36 AM Rafael J. Wysocki wrote: > > On Fri, Oct 16, 2020 at 7:18 PM Wei Wang wrote: > > > > On Fri, Oct 16, 2020 at 10:01 AM Rafael J. Wysocki wrote: > > > > > > On Fri, Oct 16, 2020 at 6:36 PM Wei Wang wrote: > > > > > > > > Currently, raw cache will be reset when next_f is changed after > > > > get_next_freq for correctness. However, it may introduce more > > > > cycles. This patch changes it to maintain the cached value instead of > > > > dropping it. > > > > > > IMV you need to be more specific about why this helps. > > > > > > > I think the idea of cached_raw_freq is to reduce the chance of calling > > cpufreq drivers (in some arch those may be costly) but sometimes the > > cache will be wiped for correctness. The purpose of this patch is to > > still keep the cached value instead of wiping them. > > Well, I see what the problem is and how the patch is attempting to > address it (which is not the best way to do that because of the extra > struct member that doesn't need to be added if I'm not mistaken), but > IMO the changelog is way too vague from the problem statement > perspective. Just want to bring this up in the mainline kernel. I think we can change the patch to use a variable insides sugov_update_single. This is adapted from Android common kernel where it has some off tree functions making a single variable not possible but also making the issue more obvious.