Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp680251ybm; Thu, 28 May 2020 12:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/gZT8N1L/xKZjQLwQmf3R3Y2dKlzyz9xPtMuh/7Fz0LX5ZkjGRClQK3I35lfs0fc11msm X-Received: by 2002:a50:a981:: with SMTP id n1mr4521523edc.377.1590693932502; Thu, 28 May 2020 12:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590693932; cv=none; d=google.com; s=arc-20160816; b=AqQKuDsmfxY8Ka+7mp+U/OIJ3T3wUcOotCzrnT6Byj8flW/+g9E9gX5c9j6vY4fTyC TbenK4TvD6oLZWQ3sULHvmqqVEJScUYhDxQvHEBsJr8jyV5IEzA5EY0Uf/I5RAjCKtFu hQ+qZMr1lAM2GFIA7PXJxZ/BxP06bWgO96glrxCUpvQWhZtzOhnDVAATmdrond2429v7 qWdxDgcBOpxN0U36ka6iii/7RfEy9yMKAUGOTGPaXk6p+EsWMR1P48qL5vwdAh6JukL4 XkdUBiqsiXAnMQGK8S6qU6LFC7uvhORb8aPuGSXebYTD5AHyob91zVJhii9qxF0TD8qs 2bmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=3sdo7vmHD4YYsWzBsxCKAg1OBvBQyzSsDb/PdpSires=; b=L4finQd1iGC7/AoByCiojs6ACgVtPc/xNtIvizzzpsCZVCTZPJ1LzFWoiiLg8bc4XC X2SAhBVcdTaCv3p2F2ZtfsyIuuAMlI06Sv7wDHHoDLgnQXr2qC18uSCOGl2kl876ZI1R KkuTCsF/jKPrYv/OgWw8weXExLaJE0gmaH8zkd8uuBNtlq45H4Xz5IlayNxkXbIIOSL6 7HeUQCFfpW/tBgMk9Dr280A6nhUm/ICC/iU3Ykm7BMKzIOWI/n4V4PvURtkDzCvLemZL sBcD5vTWleh//6Lqj/t6Pu+4s7dhytL0cYmmLIhFRB3deyNRppqz7YWI8z1xV8dsqHkQ V2ew== 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 u17si4345549eji.141.2020.05.28.12.25.09; Thu, 28 May 2020 12:25:32 -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 S2406301AbgE1TUo (ORCPT + 99 others); Thu, 28 May 2020 15:20:44 -0400 Received: from foss.arm.com ([217.140.110.172]:56456 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406225AbgE1TUk (ORCPT ); Thu, 28 May 2020 15:20:40 -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 2AFA955D; Thu, 28 May 2020 12:20:39 -0700 (PDT) Received: from [192.168.0.7] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B88C3F6C4; Thu, 28 May 2020 12:20:36 -0700 (PDT) Subject: Re: [PATCH 1/2] sched/uclamp: Add a new sysctl to control RT default boost value To: Peter Zijlstra , Qais Yousef Cc: Ingo Molnar , Randy Dunlap , Jonathan Corbet , Juri Lelli , Vincent Guittot , 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 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> From: Dietmar Eggemann Message-ID: Date: Thu, 28 May 2020 21:20:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200528182913.GQ2483@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/05/2020 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. > > 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. IIRC, it was a local mmtests netperf-udp with various buffer sizes? At least that's what we're trying to run right now on a '2 Sockets Xeon E5 2x10-Cores (40 CPUs)' w/ 3 different kernel ((1) wo_clamp (2) tsk_uclamp (3) tskgrp_uclamp). We have currently Ubuntu Desktop on it. I think that systemd uses cgroups (especially cpu controller) differently on a (Ubuntu) Server. Maybe this has an influence here as well?