Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp749624ybt; Wed, 24 Jun 2020 10:15:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx2N9s5tYk0xs7Re3NUc72aMDD2KcVHP9/m/8vY4dhiWK6Cb13d6Oe33wYVg3Gk1x4A9sl X-Received: by 2002:a05:6402:7cb:: with SMTP id u11mr26804620edy.316.1593018925814; Wed, 24 Jun 2020 10:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593018925; cv=none; d=google.com; s=arc-20160816; b=Ko7nKroh/L8LF5Kok4fvTw78Mn2gTUYlTea0QywsOtnADwUXr08+XxK7GAgeIfhUSo 87wB40lquI95UCkeZAwuosLeOc57az3Qitqv0VgIQhxBGqygbe9TPUu1dnjHIdrU+sXS YQCWU+Q96vSd6cAadHCDP0AyRiXsJbVoWUA5n6PLeHujxRR768VKmwZxr8Csijg5GfyU IZ74HpYdaEgpuuPOAjsrUFrWqoIUVH/6BIo6n0pxq1C472JvVwnuxAisRHDzKt/RDfQY A0YsHfbxJd15gsOyxM6ZPxKyt0p0SJeMt26ME+aZVRa7Ywmpb6+2SYW0K38mv+4HDG+d BR3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZLHoswG7OtabZa80+0CDVrLLWyzuGv6pjGn520D6QnQ=; b=M5/vuLAiXlnqCBOKbsI71JSUQgVCY2TyR89VRE22oIow+CkuA1D2Sc4vlmqUjpWN9f zMl0YDPkEJbwYLMPdqoiT9j5SXnV0mEX/Cu5xoSTO2BUFbxC7sFf1+lsbhuZ1YAZP5VV Tpug3SZvWwScPpLZB1d3Hh9LuVo2J6AVabYA/oQvnO6mJCMzUlkPj7dOTpY0LNFxEmWh 1Iym+TtGKvLthWlaaxw6DveJxR0ogBSU0aQa25sUxlqUdiLkZfmeIDiNP+YTvgQAogkd dqkrhDRJMiYEQgPwlG2J5H04h0JbPNgj+VIu0GX/LpJyfA0o9dhlOqV8lnVQ9Sk4cjWY vtJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi27si15239707edb.232.2020.06.24.10.15.02; Wed, 24 Jun 2020 10:15:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405379AbgFXROn (ORCPT + 99 others); Wed, 24 Jun 2020 13:14:43 -0400 Received: from foss.arm.com ([217.140.110.172]:45238 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404287AbgFXROn (ORCPT ); Wed, 24 Jun 2020 13:14:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 786AF1FB; Wed, 24 Jun 2020 10:14:42 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E77983F71E; Wed, 24 Jun 2020 10:14:40 -0700 (PDT) Date: Wed, 24 Jun 2020 18:14:38 +0100 From: Qais Yousef To: Peter Zijlstra Cc: Doug Anderson , Benson Leung , Enric Balletbo i Serra , hsinyi@chromium.org, Joel Fernandes , Nicolas Boichat , Gwendal Grignou , Quentin Perret , ctheegal@codeaurora.org, Guenter Roeck , LKML Subject: Re: [PATCH] cros_ec_spi: Even though we're RT priority, don't bump cpu freq Message-ID: <20200624171438.olo5qlivf6agbjyn@e107158-lin.cambridge.arm.com> 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> <20200624160109.GK4781@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200624160109.GK4781@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/24/20 18:01, Peter Zijlstra wrote: > On Tue, Jun 23, 2020 at 05:40:21PM +0100, Qais Yousef wrote: > > On 06/22/20 11:21, Doug Anderson wrote: > > > > [...] > > > > > > If you propose something that will help the discussion. I think based on the > > > > same approach Peter has taken to prevent random RT priorities. In uclamp case > > > > I think we just want to allow driver to opt RT tasks out of the default > > > > boosting behavior. > > > > > > > > I'm a bit wary that this extra layer of tuning might create a confusion, but > > > > I can't reason about why is it bad for a driver to say I don't want my RT task > > > > to be boosted too. > > > > > > Right. I was basically just trying to say "turn my boosting off". > > > > > > ...so I guess you're saying that doing a v2 of my patch with the > > > proper #ifdef protection wouldn't be a good way to go and I'd need to > > > propose some sort of API for this? > > > > It's up to Peter really. > > > > It concerns me in general to start having in-kernel users of uclamp that might > > end up setting random values (like we ended having random RT priorities), that > > really don't mean a lot outside the context of the specific system it was > > tested on. Given the kernel could run anywhere, it's hard to rationalize what's > > okay or not. > > > > Opting out of default RT boost for a specific task in the kernel, could make > > sense though it still concerns me for the same reasons. Is this okay for all > > possible systems this can run on? > > > > It feels better for userspace to turn RT boosting off for all tasks if you know > > your system is powerful, or use the per task API to switch off boosting for the > > tasks you know they don't need it. > > > > But if we want to allow in-kernel users, IMO it needs to be done in > > a controlled way, in a similar manner Peter changed how RT priority can be set > > in the kernel. > > > > It would be good hear what Peter thinks. > > Hurmph.. I think I understand the problem, but I'm not sure what to do > about it :-( > > Esp. given the uclamp optimization patches now under consideration. That > is, if random drivers are going to install uclamps, then that will > automagically enable the static_key and make the scheduler slower, even > if that driver isn't particularly interesting to the user. For some reason this didn't land in my inbox. Yeah I was considering how we can handle this potential new user without a clash. But I thought we first need to agree this is indeed the right thing to do. The easiest way is to make the new API act on the task struct directly rather than go through sched_setscheduler(). I.e: a wrapper around uclamp_se_set(). But first, I think we need to consider how accessible we want to keep sched_setscheduler(). IMO it should be hidden because of its potential misuse/abuse. Happy to help with that if you agree. Thanks -- Qais Yousef