Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp645615ybm; Thu, 28 May 2020 11:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE4FK+BSJJurpB8FHhVo3NyOkzDCKrob5vi4voNHTS0B/ALzP9Ao/Ks+dXWMa9eagx3zs3 X-Received: by 2002:a05:6402:177c:: with SMTP id da28mr4550738edb.378.1590690739024; Thu, 28 May 2020 11:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590690739; cv=none; d=google.com; s=arc-20160816; b=YANNddjnMqIlZW939RJfbHFcIpb/GfTYXZCPitgnTGzOBmk+yicSkOMmNx29UZsQCo EgCAuonRBjNwsXNsj6TDtL21MDdkRO4cc49yFSNeyDRryfszrRRhmloeAExljc3Zj8S9 7NbLNxf4Q961BjmO7dBCPgSUppIoAg09XFDQ8JzSNbPL2TuYSwVJmPTH0Q4NdpFnYHIl BVoABKZ58eP+hkIOa+tRzx8NsCkm7adih0roSjTBzuPim+4MPhTCcNXDVtCRdaioNhnO DmxC/RrKsXmh36NR3CGwujB73Ucp1zsdCt4yZgu8nhn5OGoMwF6kuwCe4T1uCA6mL6an Vohw== 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:dkim-signature; bh=rHMEzb11uh2HkVb3MRV65qzSdnkQbtUfzMniKNSh5V4=; b=YbXujxHoISYcN0Ku4w3Bl7OcvSQxw/bfRaNS47jRfMM22ObnPhAAXiLFsoey1PL42o ZkmAa3kel96uAu9456494MI8qLv101B0HPfjq/mBIU+flmwVMIt8vpGfNaXGV+fKYGaH /tcRc03UaHseVoFyszmCxIqBOpRjVAbJ0p9Q5X2NMHJrkrJobLjcwESkjGQ/ZuDZXTdQ JdmARo+iGoqjSaoGw2SDlCsFvTPbgatusVVpm2HuK6WWb37wrGiqZWt7+ZIwvnBqfXQs xfSCWbBr88t0Ao47bvTDFDSBqDstyxtTNcRCLLUWQpCivGIspPX2kV/EvJjDdUYq4sbr 4XFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="l6I4q/VN"; 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 j7si4077754eja.739.2020.05.28.11.31.55; Thu, 28 May 2020 11:32:19 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="l6I4q/VN"; 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 S2405792AbgE1S3m (ORCPT + 99 others); Thu, 28 May 2020 14:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405744AbgE1S3l (ORCPT ); Thu, 28 May 2020 14:29:41 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B7CCC08C5C6; Thu, 28 May 2020 11:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rHMEzb11uh2HkVb3MRV65qzSdnkQbtUfzMniKNSh5V4=; b=l6I4q/VNvcMk9WtCZ7L3CtVjsD 4RdeCehuLo5Y+5/uJwh7db/V7hlgZ2wuCeIFjt/sepFaXsjq20myaWbxJ+C14e4PKFGuXMNJeG6DC DdnyXJ13RvVu4IsViLZQUgaRNGJhkFexoU6bS1/U5wE2AORU73PIYycA9cBtwGM+aqfOX+tcgbtyV AK6lJiwvF5GXamTSHziGU2E2jaXHBzIMxAvc+5FH3onDIZlmvZxRTzhtxPkOMDaAmcfTP/EvN/g4i INBw4+6Lw3RVFUN+tNNvi2E/yzHJePRXzMTwLF0FZcJ3wBYWAOa5MaUTV9LzkOnH43ManVv/M6LPA KUJsTyQw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeNHJ-0001Er-1U; Thu, 28 May 2020 18:29:17 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 116BE9836F8; Thu, 28 May 2020 20:29:14 +0200 (CEST) Date: Thu, 28 May 2020 20:29:14 +0200 From: Peter Zijlstra To: Qais Yousef 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: <20200528182913.GQ2483@worktop.programming.kicks-ass.net> 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> <20200528165130.m5unoewcncuvxynn@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200528165130.m5unoewcncuvxynn@e107158-lin.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 05:51:31PM +0100, Qais Yousef wrote: > 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 :-) Mostly true; but you also had a load of that sysctl in there, which is likely to be a miss, and those are expensive. Also; if we're going to have to optimize this, less logic is in there, the less we need to take out. Esp. for stuff that 'never' changes, like this. > > 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. Basic rule, if the state 'never' changes, don't touch fast paths. Such little things can be very difficult to measure, but at some point they cause death-by-a-thousnd-cuts. > > 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. Right, I remember us doing benchmarks when we introduced all this and clearly we missed something. I would be good if Mel can share which benchmark hurt most so we can go have a look.