Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp800994ybt; Wed, 24 Jun 2020 11:30:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfqVZsHRuZZBSids3ew9xd7YBzfObra92WAikPfmrG9lPyj24BzGhrRZkzO3A7VGj/hKcS X-Received: by 2002:a05:6402:206b:: with SMTP id bd11mr13501113edb.143.1593023458144; Wed, 24 Jun 2020 11:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593023458; cv=none; d=google.com; s=arc-20160816; b=OqDB6At0lkuz02av5hj9zX6ve0Ywgq2CisC/J1GyNoG2v9jyVESAfnhjQiAorPgldN baMk4BCvJLAIW3wiuY1oX9BecNp5ayOyz0/Br7e7tVk9SPlAxViV9a5DCaL3JYD3KZyS yOhr1ZexPKRco+kmX9bg00AE/USsk5+SLSqtlfc7EFZHq2eqMWb+GWA2DTU64VPESvOl 5tSqa0P5oy5eeWu5vvdfRQ1hEuEWNHA8Ar2eW9dI55dKafzcchS0SsAs90yXbF/63Brz xUsNnswmpnvqN+i8nihdQyGK8Wpymx8LXPnpPsMdfVN3zJnEcg0pYetsu6A0KoFznwXc 8kVA== 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=5dObdCDUTrGFI/rx0m6U4tkE0B1+Fpf7lvaFecAoxjc=; b=w0EDF/wHOSDaj783Pr1qmzJVGH2HxOAsddfgxQTV4QOziufgymMVF5Jue7WCdsRNyE Amn2PL3fGTJerSoglhyjXQ64aMy0pQogxKWwpwOfc6N3oOzH6YqA7G52tUX6Jrqs24ex Vijj25LPdCYigAAfYd0s6Zo2/bAOehX1ugNKnFSulECFh2cywI/DQCZpKbfJaVo7V+VA 3NRcYx6hGAEWA2UyP0klTWqoCyA6pp7bWDWp98Ab9t6Jm74T78coqGN5z6eWcL4O2U6x KKCBvLKMS71CuYZsn80DMErp5XegpnIPlT3rBtNqOoRRUzClohIqVZRwnOAusKL3G9zR ep/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QG1IoYl2; 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 dp11si18570595ejc.463.2020.06.24.11.30.31; Wed, 24 Jun 2020 11:30:58 -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=QG1IoYl2; 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 S2406096AbgFXSaE (ORCPT + 99 others); Wed, 24 Jun 2020 14:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405919AbgFXSaD (ORCPT ); Wed, 24 Jun 2020 14:30:03 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 912DCC061573 for ; Wed, 24 Jun 2020 11:30:03 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id m23so765892vko.2 for ; Wed, 24 Jun 2020 11:30:03 -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=5dObdCDUTrGFI/rx0m6U4tkE0B1+Fpf7lvaFecAoxjc=; b=QG1IoYl2UihR1f8keD2I0PqA1hErW8jHJyqbAJ1iZ0wAfRmNkrxmOnhtgxgb0BNFeo YEhwZ3GV5ICNGD42hQwAQrFo1uOiwP++NJ8FiYE12YlQvuOyzb8+zi9BAVMzydWF41Kq hAYLIPpRLQfNzmkqDC5tK9B+jr8owYrnPrGwQ= 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=5dObdCDUTrGFI/rx0m6U4tkE0B1+Fpf7lvaFecAoxjc=; b=ThWCS/aSIT19OX0jbI3yj0msTV9nherXTMheuWnwzzSKVOEn8Uh+phYWPrXveHlJFl ytAnq23FG/Y8VK0OGdMsyLLe15R620veqhfyPgYQYu4cRC0/nJQWPcfqdAgSzZ0+oNo/ pGrnlpm/EbfTMF6DosRG5hyDBR9b/nE+z6/oIwpJq+1tzQBi5u4EWM07ayWc1GJuPHvs bJ+ubJ3gZpNhypeo+RjHccL9mm6sdPaCkulyhLGzb8LgeihMszn6RvCQa+wd70Ep2UmL t5WdrS8flfYLWJVQz3VKVX3+Ev5xaKRuF5Clxbrk+VYCD0Igs0f5iXKw0Z0vGvQy2q/U Ddmw== X-Gm-Message-State: AOAM530c+VErVb4DDBjs9XWCaPe2MK0K+WQyzQHLc548irOb64E4KxN1 IGxEKmA03B8XsKoaYO6tLRdpv8tnmnA= X-Received: by 2002:a1f:9958:: with SMTP id b85mr11878891vke.48.1593023401706; Wed, 24 Jun 2020 11:30:01 -0700 (PDT) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id b193sm1039861vke.41.2020.06.24.11.29.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2020 11:30:00 -0700 (PDT) Received: by mail-vs1-f48.google.com with SMTP id e15so1969232vsc.7 for ; Wed, 24 Jun 2020 11:29:59 -0700 (PDT) X-Received: by 2002:a67:62c4:: with SMTP id w187mr23023350vsb.109.1593023398932; Wed, 24 Jun 2020 11:29:58 -0700 (PDT) MIME-Version: 1.0 References: <20200610151818.1.I666ecd9c6f3c6405bd75831a21001b8109b6438c@changeid> <20200612125250.7bwjfnxhurdf5bwj@e107158-lin.cambridge.arm.com> <20200619153851.vigshoae3ahiy63x@e107158-lin.cambridge.arm.com> <20200623164021.lcrnwpli7wdlsn5i@e107158-lin.cambridge.arm.com> <20200624165500.idrugfgplqgi654v@e107158-lin.cambridge.arm.com> <20200624175236.nblndmg6dfq2vr2u@e107158-lin.cambridge.arm.com> In-Reply-To: From: Doug Anderson Date: Wed, 24 Jun 2020 11:29:47 -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: Joel Fernandes Cc: Qais Yousef , Peter Zijlstra , Benson Leung , Enric Balletbo i Serra , hsinyi@chromium.org, Nicolas Boichat , Gwendal Grignou , Quentin Perret , 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 Wed, Jun 24, 2020 at 10:55 AM Joel Fernandes wrote: > > On Wed, Jun 24, 2020 at 1:52 PM Qais Yousef wrote: > > > > On 06/24/20 13:35, Joel Fernandes wrote: > > > > [...] > > > > > > Doing the in-kernel opt-out via API should be fine, I think. But this will > > > > need to be discussed in the wider circle. It will already clash with this for > > > > example > > > > > > > > https://lore.kernel.org/lkml/20200619172011.5810-1-qais.yousef@arm.com/ > > > > > > Have not yet looked closer at that patch, but are you saying this > > > patch clashes with that work? Sorry I am operating on 2 hours of sleep > > > here. > > > > The series is an optimization to remove the uclamp overhead from the scheduler > > fastpath until the userspace uses it. It introduces a static key that is > > disabled by default and will cause uclamp logic not to execute in the fast > > path. Once the userspace starts using util clamp, which we detect by either > > > > 1. Changing uclamp value of a task with sched_setattr() > > 2. Modifying the default sysctl_sched_util_clamp_{min, max} > > 3. Modifying the default cpu.uclamp.{min, max} value in cgroup > > > > If we start having in-kernel users changing uclamp value this means drivers > > will cause the system to opt-in into uclamp automatically even if the > > userspace doesn't actually use it. > > > > I think we can solve this by providing a special API to opt-out safely. Which > > is the right thing to do anyway even if we didn't have this clash. > > Makes sense, thanks. OK, so I think the summary is: 1. There are enough external dependencies that are currently in the works that it makes sense for those to land first without trying to cram my patch to cros_ec in. 2. Maybe, as part of the work that's already going on, someone will add an API that I can use. If so then I can write my patch once that lands. 3. If nobody adds an API then I could look at adding the API myself once everything else is settled. 4. It looks as if the patch you mentioned originally [1] that allows userspace to just fully disable uclamp for RT tasks will land eventually (if we're stuck for a short term solution we can pick the existing patch). I believe Chrome OS will use that to just fully disable the default boosting for RT tasks across our system and (if needed) add boosts on a case-by-case basis. Once we do that, the incentive to land a patch for cros_ec will be mostly gone and probably we could consider my patch abandoned. While it would technically still be sane to land it won't have any real-world benefit. [1] https://lore.kernel.org/r/20200511154053.7822-1-qais.yousef@arm.com