Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1488687ybg; Thu, 11 Jun 2020 11:08:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoOxDtpI+mp1pk2tehngHRMutwEZ+lExIgneMUaO5NgMfDzbzx+GfMUC5K18Z1mdOvleGD X-Received: by 2002:a17:906:c2c6:: with SMTP id ch6mr9272656ejb.36.1591898898702; Thu, 11 Jun 2020 11:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591898898; cv=none; d=google.com; s=arc-20160816; b=ZdiAt+ObTUzB8BXjBdMPBYnAupfHtRnutoLbk0FQmznzo9VEbU/+dVx9B7pBO9H+FK CRdCUMdUP2mep08GiM0aBgJIw4xC3ZBgeVBE8ysS/8qpZAfimqtck4m7n9MHuAcJT8Gs GMbXsQNwSg27mJ3HRTY5pfqhKBZq9komcu6MO5if45dEBrAlOOlhx5d1ApO7VS+o/z6c YZi50TSfYYa67tN6qFJCMkd4D+DQxX72oYguYjcffVHq2KTSx1z9MFkdNhDa+t5G+mMb fz8CMI2Qk0j2ZWit4BFiuUU6val6pjdGko6MEbdyJNxYE2PZ3qBl4Rd4U5fO0zPaUbPy pokQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=acirWtrOI5aXX0aAE7Go5x1+MEKzhG9T4nruOYiS7c4=; b=PvYxy94NOfa20u4lM25uD/d1GFZyqazaqEg0f2r64H6CFyI+GpGVN+ZlvCfuT3nY4g b3ZRNYD8z/e4BH9PoB3gocr7PFn24cgWmdv9FzbRYyFd242YsxK5lym9lc1efP1/j1+n jUmjkXL/bR+VlDF6SlbRNvSHj22NWO3xq6jUr/aTo+7+6O8bImtPUwZJWL6E6llz3L6U dpyeHzaJmXJvm8LCURwDeOMIX/8qpuwsY6SdHAHXTa9LHLelcVcS/RifttCUgy9qjaTO xa6FTErKExkoc/hhu/wuP9Hdqf9XooNTsKzu9TMOTlTYcN24AqCdOr2Qgm1hlV/ph5Gw Owkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SG3jcoZB; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c13si1990928edk.57.2020.06.11.11.07.55; Thu, 11 Jun 2020 11:08:18 -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=@chromium.org header.s=google header.b=SG3jcoZB; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgFKRsz (ORCPT + 99 others); Thu, 11 Jun 2020 13:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725824AbgFKRsz (ORCPT ); Thu, 11 Jun 2020 13:48:55 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C862C03E96F for ; Thu, 11 Jun 2020 10:48:55 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id g129so3890102vsc.4 for ; Thu, 11 Jun 2020 10:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=acirWtrOI5aXX0aAE7Go5x1+MEKzhG9T4nruOYiS7c4=; b=SG3jcoZBkXk2ifRHzGvBnYoSfCtkFZBRFAIginsgbJIZBS+pWSLmpfD4AOBgoaCdLK B8/EthGFAPz3qCoSQr9Iifvtby3G5VE+cTnfiZfGmnJRe8XOZQdNLgA5+olKutx4uVGN iKOO7wzCdCHyPVjPCyiLN/wjVXP6numj+2aXI= 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=acirWtrOI5aXX0aAE7Go5x1+MEKzhG9T4nruOYiS7c4=; b=IA3YScEUMOQr0uQ6R/CBXRcY9r+ErIuWv+wEKOwcdh5cINeWxHCMTjlC7VRf44LrY7 L0R/qMHuBcvNtWNtNMT+s0DA0jTohjqOeIqHIDJjmqNjt9LQdYJTmfZQNP8B2g323DNO LRPRfTJNmwfQ1LSUpvUZe340mLabTqzaWNim477uX+buXg5nB1+3tS+n7m8FHVMgIb5f xolVd92c1QHqGSydrBcfputDtlQScye4+aWY1j1NNWPaBpquuk4IdhSSHQYXdZrAJois lONpldMMg/+6R6An+2SwT3OVWpunczcYWAkiQBy9SN+Z0mRrB62/J4V8SvOGc/uNcVBf F6Ag== X-Gm-Message-State: AOAM533Wz/RyUP55vvCyIPgQmged2Z7r0lsSD1iTPsGbghkbr1JKYGED myvcGahNCsMW16oaMde4J1jsj/1mFm4= X-Received: by 2002:a67:e19d:: with SMTP id e29mr7621146vsl.9.1591897733454; Thu, 11 Jun 2020 10:48:53 -0700 (PDT) Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com. [209.85.221.179]) by smtp.gmail.com with ESMTPSA id 44sm455435uas.3.2020.06.11.10.48.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2020 10:48:53 -0700 (PDT) Received: by mail-vk1-f179.google.com with SMTP id i1so1660364vkp.8 for ; Thu, 11 Jun 2020 10:48:52 -0700 (PDT) X-Received: by 2002:a1f:280c:: with SMTP id o12mr7040118vko.92.1591897731903; Thu, 11 Jun 2020 10:48:51 -0700 (PDT) MIME-Version: 1.0 References: <20200610151818.1.I666ecd9c6f3c6405bd75831a21001b8109b6438c@changeid> <20200611110301.GA132747@google.com> In-Reply-To: <20200611110301.GA132747@google.com> From: Doug Anderson Date: Thu, 11 Jun 2020 10:48:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] cros_ec_spi: Even though we're RT priority, don't bump cpu freq To: Quentin Perret Cc: Benson Leung , Enric Balletbo i Serra , hsinyi@chromium.org, Joel Fernandes , Peter Zijlstra , Nicolas Boichat , Gwendal Grignou , ctheegal@codeaurora.org, Guenter Roeck , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jun 11, 2020 at 4:03 AM Quentin Perret wrote: > > Hi Doug, > > On Wednesday 10 Jun 2020 at 15:18:43 (-0700), Douglas Anderson wrote: > > The cros_ec_spi driver is realtime priority so that it doesn't get > > preempted by other taks while it's talking to the EC but overall it > > really doesn't need lots of compute power. Unfortunately, by default, > > the kernel assumes that all realtime tasks should cause the cpufreq to > > jump to max and burn through power to get things done as quickly as > > possible. That's just not the correct behavior for cros_ec_spi. > > Is this specific to this driver, or something you would want applied > more globally to all RT tasks in ChromeOS (which is what we'd like to > have in Android for instance)? Hrm. I guess my first instinct is to say that we still want this patch even if we have something that is applied more globally. Specifically it sounds as if the patch you point at is suggesting that we'd tweak the boost value to something other than max but we'd still have a boost value. In the case of cros_ec_spi I don't believe we need any boost value at all, so my patch would still be useful. The computational needs of cros_ec_spi are very modest and it can do its work at lower CPU frequencies just fine. It just can't be interrupted for large swaths of time. > IOW, how do you feel about 20200511154053.7822-1-qais.yousef@arm.com ? I'm not totally a fan, but I'm definitely not an expert in this area (I've also only read the patch description and not the patch or the whole thread). I really don't want yet another value that I need to tune from board to board. Even worse, this tuning value isn't board-specific but a combination of board and software specific. By this, I'd imagine a scenario where you're using a real-time task to get audio decoding done within a certain latency. I guess you'd tune this value to make sure that you can get all your audio decoding done in time but also not burn extra power. Now, imagine that the OS upgrades and the audio task suddenly has to decode more complex streams. You've got to go across all of your boards and re-tune every one? ...or, nobody thinks about it and older boards start getting stuttery audio? Perhaps the opposite happens and someone comes up with a newer lower-cpu-intensive codec and you could save power. Sounds like a bit of a nightmare. I'd rather have a boolean value: boost all RT threads to max vs. don't boost all RT threads to max. Someone that just wanted RT stuff to run as fast as possible without any hassle on their system and didn't care about power efficiency could turn this on. Anyone who really cared about power could turn this off and then could find a more targeted way to boost things, hopefully in a way that doesn't require tuning. One option would be to still boost the CPU to max but only for certain tasks known to be really latency sensitive. Another might be to somehow measure whether or not the task is making its deadlines and boost the CPU frequency up if deadlines are not being met. I'm sure there are fancier ways. ...of course, I believe your patch allows me to do what I want: I can just set the default boost to 0. It just leaves in the temptation for others to require a default boost of something else and then I'm stuck in my tuning nightmare. -Doug -Doug