Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3247629imc; Wed, 13 Mar 2019 12:40:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyscnFSAelggnNWahkLCkovmO5DLEPZsH8bdBEuo6XnX8+Cx4nHVEBStrcShj4iv4zMDO0u X-Received: by 2002:a63:fb16:: with SMTP id o22mr40705662pgh.209.1552506018771; Wed, 13 Mar 2019 12:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552506018; cv=none; d=google.com; s=arc-20160816; b=R0PyIxq/+c96x3m03hCnX4ZfHjwE3nIcdbTBH1wBlEqQvaACgc+jK85LScb8yvHLy9 H17vvViuMPzz8Dv7DNqsn0/bSa5h/Z6VWpuEShuuI9FPk/MzWIaR6HpRQ5o9CQ5QHw58 JGorgjCKNDypz1bFRHTgTqsw0UDfMeyE/ql21MZBkDItxwr4b+uuLLbdXrOvgz5Xy+rj dXnhqd+4GSWGZ6Yv/sOuLdtxdBxMqPFIVC09oMOmp1moU5VzLm2ArRyerlkHqvHjIWSS cSV03qBiDqKBI/bwKk0EpbWkqQfqmkV1p+BJahGKUbaGmlq08wfbztNUOoLCJAxWZ4CQ 2a7A== 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=mkAEJ6osON4cSSNuJ8mxtyGzpNSZBltB7dt4tPBVi9g=; b=WK4zRwBMzj8aIcdpWqCHFqSiZb+MVIvCZnIjIi0GoJ+KJXL0CGPmwi7s+PHvTXRSlw 9DzpUUn2RCTam7RCdpCUj2UOWZYqqyHG7saKpFYt9+NfHh4k0Mmn7yvhN2xvqUoGWYqw Gt/pKGvvYOEkgNWmNP2YEeXIyEwjt6OMVB8OyqxwKH6XFgGHhCRji03Rry5MFNwBKuTH ewc3Gn4v47MDF4goVhZ3ruGmw6yPe7ujkd1BIwz1ndYvkO2fJ09BBiFFAa3AJa1f+kv8 JJcW5ujNlWUCmYKdZMLZCKgbpdKHhtUKpV9K4OicAQGifCc/ZxOua5QN7bxnfqs1fwH+ vlzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KgpbwLjH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q65si10969759pfi.185.2019.03.13.12.40.02; Wed, 13 Mar 2019 12:40:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KgpbwLjH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbfCMTjY (ORCPT + 99 others); Wed, 13 Mar 2019 15:39:24 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40680 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfCMTjY (ORCPT ); Wed, 13 Mar 2019 15:39:24 -0400 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mkAEJ6osON4cSSNuJ8mxtyGzpNSZBltB7dt4tPBVi9g=; b=KgpbwLjHM6V8njnyaCm0cmoXB 2bvSK+juXv3zR861JbkUiHZBwry8kN3ETgAqPCmhYwwGqdfD8yE7yNYz9Rv55bSo9TFGTSWTB5ML5 ZDwJfdJwdzM5Gy3tKHhcPVHxBbwXjfI27yxyL9GmhVE5bbYYocpLS8qbcmwa0j6QKtbRA2eI3S5dD dPm43VyA1lvfgFHh72xuPjqGpWWr7N/EN7MXaRLxpmnQ6G6wZa1mfoOCPbD+B0W0EUxlbHWddWWOR YCvOLCbi3v/P53FmGVIczlW2xTLDXjoIw4MqD6Rc8nogu+bDFCkZTipXbc1b+nHDZGtabvU2GUod9 4uJ/0Nlzg==; 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.90_1 #2 (Red Hat Linux)) id 1h49ih-0007sD-DM; Wed, 13 Mar 2019 19:39:19 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A9FE69826C0; Wed, 13 Mar 2019 20:39:16 +0100 (CET) Date: Wed, 13 Mar 2019 20:39:16 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting Message-ID: <20190313193916.GQ2482@worktop.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> <20190313135238.GC5922@hirez.programming.kicks-ass.net> <20190313155954.jse2tyn5iqxm6wle@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313155954.jse2tyn5iqxm6wle@e110439-lin> 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 Wed, Mar 13, 2019 at 03:59:54PM +0000, Patrick Bellasi wrote: > On 13-Mar 14:52, Peter Zijlstra wrote: > Because of backetization, we potentially end up tracking tasks with > different requested clamp values in the same bucket. > > For example, with 20% bucket size, we can have: > Task1: util_min=25% > Task2: util_min=35% > accounted in the same bucket. > > Given all that, what is to stop the bucket value to climbing to > > uclamp_bucket_value(+1)-1 and staying there (provided there's someone > > runnable)? > > Nothing... but that's an expected consequence of bucketization. No, it is not. > > Why are we doing this... ? > > You can either decide to: > > a) always boost tasks to just the bucket nominal value > thus always penalizing both Task1 and Task2 of the example above This is the expected behaviour. When was the last time your histogram did something like b? > b) always boost tasks to the bucket "max" value > thus always overboosting both Task1 and Task2 of the example above > > The solution above instead has a very good property: in systems > where you have only few and well defined clamp values we always > provide the exact boost. > > For example, if your system requires only 23% and 47% boost values > (totally random numbers), then you can always get the exact boost > required using just 3 bucksts or ~33% size each. > > In systems where you don't know which boost values you will have, you > can still defined the maximum overboost granularity you accept for > each task by just tuning the number of clamp groups. For example, with > 20 groups you can have a 5% max overboost. Maybe, but this is not a direct concequence of buckets, but an additional heuristic that might work well in this case. Maybe split this out in a separate patch? So start with the trivial bucket, and then do this change on top with the above few paragraphs as changelog?