Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp372306ybm; Fri, 29 May 2020 02:14:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmI2f1Nbi7sZf3IDg32ZARQo2nVYW3++6poDiOTnH24K4JUjq75U82OTGjtcRoajYe9RPp X-Received: by 2002:a17:906:51b:: with SMTP id j27mr6375345eja.246.1590743668502; Fri, 29 May 2020 02:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590743668; cv=none; d=google.com; s=arc-20160816; b=SEsG0BQG7CkmicE3xY9G3WYEwaRfbf2wsutOobos5ktQ7+Y8EpuF5x19sHX1qgzphX kAUZe3ig1IC6wyhjneL5YTpd9aSKc48y0PqP0WRPge1uXzzDydSOJe0mSXSNfcJBtLjV A1gkeqFYe+N+m7vAkeealSP2cdzuZBbOAq1DGTqnKci5jHKlq/VSqLPhBTKZu1kemhJS 0MplTPBFjppM3LHWHiwaIfeW9ruDrXY0THQ4D1SQrfiWugXdLo2O+CParH+eLWEz7RMj +7oB1GO/lWrvnpGgTFnjz7pG2V5Ga5sR9VgUOawJEptXs3Xnq9TXnMgnlg2e5h4eQAH2 kFJw== 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=gIrUooT6UY5D45b1C471oFuOdKET0BtdlKp3BU3bKCU=; b=CAf55wSSy93INhs0+kTHCJP6uz8yes9Q7+gPO7OW7FsiD/EJB2LzzUh8iiKRpQ/aX7 KjNeNrSXmhwBFHJp+Q0ELFu+mrQEepT8mtKJdOVXYIwwEdXyge8lzSLw4+1cXtthMzib GC84hjG5rem7afYSnvXoXIjUOYaGPl3nE3q+UDgwwnwtLyS5MnEryY9axomHRfTVenId 3Kd1oZLTyf3bSI4n6GVctvtQCD9CJmQ4PQQfAAuNoThuL9ad0Mt7wfIiqHxoKNg3nsbc QwWVFalCRj1um0oS2t8H9H0LDKU7i7WrQVTEgpIW6b3lnZUX1jll3pkzMfb3eYQPwtMh em8Q== 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 t5si583688ejs.458.2020.05.29.02.14.04; Fri, 29 May 2020 02:14:28 -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 S1726529AbgE2JLx (ORCPT + 99 others); Fri, 29 May 2020 05:11:53 -0400 Received: from foss.arm.com ([217.140.110.172]:33990 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbgE2JLw (ORCPT ); Fri, 29 May 2020 05:11:52 -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 986A61045; Fri, 29 May 2020 02:11:51 -0700 (PDT) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF41E3F52E; Fri, 29 May 2020 02:11:48 -0700 (PDT) Date: Fri, 29 May 2020 10:11:46 +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: <20200529091145.irvbvxxvhbetbwvw@e107158-lin> 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> <20200528182913.GQ2483@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200528182913.GQ2483@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 20:29, Peter Zijlstra wrote: > 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. Hmm yes there's no guarantee the sysctl global variable will be in LLC, though I thought that would be the likely case. > > 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. Agreed. > > > > 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. Yeah we're bound to reach the critical mass at some point if too much bloat creeps up on the hot path. Thanks -- Qais Yousef > > > > 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.