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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59D06C001E0 for ; Tue, 1 Aug 2023 09:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233483AbjHAJuU (ORCPT ); Tue, 1 Aug 2023 05:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233729AbjHAJuD (ORCPT ); Tue, 1 Aug 2023 05:50:03 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDEE8212F for ; Tue, 1 Aug 2023 02:49:35 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99bed101b70so663583566b.3 for ; Tue, 01 Aug 2023 02:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690883374; x=1691488174; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=j8Aw/q2325QhvfRmv9aBcluZMD54mucilqUf7AAqeNY=; b=6MjFQXPW/mZ+3XWbBfRbNcNoy53tZnxETpLjJSAtIpKe+cSorJsstEpg6WVvdiTiW8 2+iibuAEVZiriSShY+nTrlnWMKhu1f/fdG6tkwuzKbU1/6QyPGUBNUZa2A9kwdRah/Dg MCX75gah/0Rt2Q3c/xyfE4SasPNuDRZ0vWpaHg+5BJiD8Uk85Xw4AK49GN3gt3Pb5Pjl ib3mbA5Gz+vlCz6/8FRUj/lOd8snqoFRXSKE2lDgG17YuUq/huNyk8kcpmWwupjkk6aw ZC/2Vt28Qnau8yZQKUX8MedyNlM5Gt7F8mfiXBh5S6HeOELAc4zNlnnhvLZN2bl603rw 54IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690883374; x=1691488174; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=j8Aw/q2325QhvfRmv9aBcluZMD54mucilqUf7AAqeNY=; b=Ag2zKXrXSpNOn7ruvw88Ty09OVp1P6L0Y9Fb0v6xJSRg92De31KmspXYUepjpugPpr ogsnWCHtjmoAYcumDNRGyS2dLHmZ873pZ5Y4kNQNCz8LEJlhXUCWO+pRb/nxfzBjOtbi 01cEGz3b+ELIMNdTvv6yUF3ppacGTjLqVEHQgaGgyfKywZBEoIUr7JGE0+Rlo2XpkxqO rLbRwGX90yeyP9By1r49oNsgbVtZYEXHopH/cFyxa1NsyidV53HOU1NrKCk98vsgPSzy WaKNJcd6jeJ8e92Kb/qyJylgEevBA2pBfV/MkfaxoCn34/+OmAJrqObim7Pxj+35JM06 7kbA== X-Gm-Message-State: ABy/qLbV51X9OfGjzwhbKwrpoB6mB8XWbwis0QR7U7MlKUsybaHVB40T F5lu0BoTo7kRjMNMMsIYyQ7Zzg== X-Google-Smtp-Source: APBJJlGR0qLEiBW7LmZ6eMsyXyJJRH6PCqS7Js03DEAtTFa4qoOwaLAeE+I8AFK1mnaZSUFh4z4FeA== X-Received: by 2002:a17:907:2716:b0:98d:1f6a:fd47 with SMTP id w22-20020a170907271600b0098d1f6afd47mr2045278ejk.76.1690883374092; Tue, 01 Aug 2023 02:49:34 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id j10-20020a170906410a00b0098951bb4dc3sm7349407ejk.184.2023.08.01.02.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 02:49:33 -0700 (PDT) Date: Tue, 1 Aug 2023 09:49:30 +0000 From: Quentin Perret To: David Dai Cc: "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Saravana Kannan , Masami Hiramatsu , Will Deacon , Peter Zijlstra , Vincent Guittot , Marc Zyngier , Oliver Upton , Dietmar Eggemann , Pavan Kondeti , Gupta Pankaj , Mel Gorman , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] cpufreq: add virtual-cpufreq driver Message-ID: References: <20230731174613.4133167-1-davidai@google.com> <20230731174613.4133167-3-davidai@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tuesday 01 Aug 2023 at 09:45:22 (+0000), Quentin Perret wrote: > Hi David, > > On Monday 31 Jul 2023 at 10:46:09 (-0700), David Dai wrote: > > +static unsigned int virt_cpufreq_set_perf(struct cpufreq_policy *policy) > > +{ > > + struct virt_cpufreq_drv_data *data = policy->driver_data; > > + /* > > + * Use cached frequency to avoid rounding to freq table entries > > + * and undo 25% frequency boost applied by schedutil. > > + */ > > The VMM would be a better place for this scaling I think, the driver > can't/shouldn't make assumptions about the governor it is running with > given that this is a guest userspace decision essentially. > > IIRC the fast_switch() path is only used by schedutil, so one could > probably make a case to scale things there, but it'd be inconsistent > with the "slow" switch case, and would create a fragile dependency, so > it's probably not worth pursuing. Alternatively we could make the schedutil margin configurable via the cmdline or something along those lines, so we can set it to 0 in the guest and avoid the issue entirely. Some partners have been asking for this IIRC , so I suspect there would be interest from other parties. Thanks, Quentin