Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp579025ybm; Thu, 28 May 2020 09:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJych8cih3YxQb5agV4tB/WjU2O5oz/9jzl3lgAPonvbgWxds5qlZyI9mdb5MqzvGmNRokYD X-Received: by 2002:a17:906:6156:: with SMTP id p22mr3684703ejl.329.1590684839775; Thu, 28 May 2020 09:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590684839; cv=none; d=google.com; s=arc-20160816; b=0Scjhz+tv6zNMzYqPCoZQ1GdbPhbfgTJw2Bj5bRwNEgBnXJ1ggYahDWQBTG+Uapg11 T7C3FOdXUN5okbOarxoOSss4/ilfqJOK0nJOV8GOMyGSCOk7XEmtM/m475NMKm8M2fSh pAfE3yKc2lHnvUZ7o9tiijbN8ZFOmV4C53f362NjEKDA6tpKik5FpzqxuwBA4z6rgeJp fiwXnbs+/mAMmbvoxbWU55ibHTShLJaVvxbpL+JFKa5SphKpokeKSP5tRV9peJCk8x6a lQJr1zuLWDqLMhSHwwZ2SSrsXxEkSnrN5yTJYs66PCsHCULJwur6CLdneX1zmVd5RRaL 1hZg== 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=FBmGmQum+jHbMCpfa9ieyR0h1yza8NUVvQxRjadJA/M=; b=clHcXikasFReQaV90dsrXokc4i10GhGNGr9Y63FKQLJgUgp14/RBUEOCqpZ9KTir7H d/yKOn+pOX6o3nDScNPbQNyZRBWLA80SVAKxW7NP0Zbec6x3QW2v+VnhZjsbVQIGoUrT +DInDXRU3WKKsWju6AIlAZR3EiYjuzjLMfEj066n4s+EpxgE6sbRRYVZ6Z1K8njyUzp9 lKKnjBtFMj6cmfH7pOPkw82ED89wERDl0duvJahQ8aS1wWe7GGbnl0sua4casD3tyWQV B7ALGg8ipvyK6A7bNTZ+yzhUi83tPiO2E1CMS/saNDnP8KGHkup/5YjacCYh6rYS0Cxl yxyg== 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 f30si3878512edj.524.2020.05.28.09.53.36; Thu, 28 May 2020 09:53:59 -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 S2405242AbgE1Qvi (ORCPT + 99 others); Thu, 28 May 2020 12:51:38 -0400 Received: from foss.arm.com ([217.140.110.172]:55284 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405162AbgE1Qvg (ORCPT ); Thu, 28 May 2020 12:51:36 -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 3AB8030E; Thu, 28 May 2020 09:51:36 -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 82DA13F6C4; Thu, 28 May 2020 09:51:33 -0700 (PDT) Date: Thu, 28 May 2020 17:51:31 +0100 From: Qais Yousef To: Peter Zijlstra Cc: Ingo Molnar , Randy Dunlap , Jonathan Corbet , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Luis Chamberlain , Kees Cook , Iurii Zaikin , Quentin Perret , Valentin Schneider , Patrick Bellasi , Pavan Kondeti , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] sched/uclamp: Add a new sysctl to control RT default boost value Message-ID: <20200528165130.m5unoewcncuvxynn@e107158-lin.cambridge.arm.com> References: <20200511154053.7822-1-qais.yousef@arm.com> <20200528132327.GB706460@hirez.programming.kicks-ass.net> <20200528155800.yjrmx3hj72xreryh@e107158-lin.cambridge.arm.com> <20200528161112.GI2483@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200528161112.GI2483@worktop.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 05/28/20 18:11, Peter Zijlstra wrote: > On Thu, May 28, 2020 at 04:58:01PM +0100, Qais Yousef wrote: > > On 05/28/20 15:23, Peter Zijlstra wrote: > > > > So afaict this is directly added to the enqueue/dequeue path, and we've > > > recently already had complaints that uclamp is too slow. > > > > I wanted to keep this function simpler. > > Right; I appreciate that, but as always it's a balance between simple > and performance :-) Sure :-) In my head, the simpler version of if (rt_task(p) && !uc->user_defined) // update_uclamp_min Is a single branch and write to cache, so should be fast. I'm failing to see how this could generate an overhead tbh, but will not argue about it :-) > > > > Is there really no other way? > > > > There is my first attempt which performs the sync @ task_woken_rt(). > > > > https://lore.kernel.org/lkml/20191220164838.31619-1-qais.yousef@arm.com/ > > > > I can revert the sync function to the simpler version defined in that patch > > too. > > > > I can potentially move this to uclamp_eff_value() too. Will need to think more > > if this is enough. If task_woken_rt() is good for you, I'd say that's more > > obviously correct and better to go with it. > > task_woken_rt() is better, because that only slows down RT tasks, but > I'm thinking we can do even better by simply setting the default such > that new tasks pick it up and then (rcu) iterating all existing tasks > and modiying them. > > It's more code, but it is all outside of the normal paths where we care > about performance. I am happy to take that direction if you think it's worth it. I'm thinking task_woken_rt() is good. But again, maybe I am missing something. > > > FWIW, I think you're referring to Mel's notice in OSPM regarding the overhead. > > Trying to see what goes on in there. > > Indeed, that one. The fact that regular distros cannot enable this > feature due to performance overhead is unfortunate. It means there is a > lot less potential for this stuff. I had a humble try to catch the overhead but wasn't successful. The observation wasn't missed by us too then. On my Ubuntu 18.04 machine uclamp is enabled by default by the way. 5.3 kernel though, so uclamp task group stuff not there yet. Should check how their server distro looks like. We don't want to lose that potential! Thanks -- Qais Yousef