Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3739996imc; Thu, 14 Mar 2019 04:19:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZl/iSbm4YJdSf/A++j55Xx/p70WATqBTkDXVlU2putl+9KspckC0Zo4pYfF7p+1j4+LmY X-Received: by 2002:a17:902:1347:: with SMTP id r7mr51029314ple.82.1552562394844; Thu, 14 Mar 2019 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552562394; cv=none; d=google.com; s=arc-20160816; b=C2rV1/cn72WkuIb5hMLrbFsAZCy4EKAemdLzioGZ+YTF+vSr83p26w1GYK75gFLX3T AQc03g4uixsSFKE+UQrhfdGktkgscKvLcUCuIAVcKhY0cl2fRumtw0GoowelygD1ZIRM ru4/lTuspZlXCWblGZiX0v2x2lkT7YreumVHai6W7NVgHLiVvx5ZHIxOBRkQ3vrEARPe uZzD7bbpSfNXidN/ZfLzlZKgc7MJOJz2F8ZAw093iuRCdRwsOUldn2p7YnbIXxEms32z D5PmlmtLvwTkYfpZNG+1mO0aiPlarnJ52g7jvprQU51RvIeq9JHhEZydGWcF9ozFjQen +E9A== 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=+InhiBwbQoTA6gfMJmw1rH9cKHN5kbDAxio0yd9l/XE=; b=UXwiwfe6QqDLljhcjiliW+xYpbUzh2CrlyYnyaDJcXSSYdtqaksph/mWnNJiI/hbjF EzHEoWn1tqhs8rmsw05z1LyEQx9oWKpcqcYbi3k8NRn+dj32Lq6zG9QJ+oPLyOnWSoTM OYGMNQN1PgvN/JPb62FDFhP0b4I4Mo/6kSM591A8V8mAWLKCiSdVU4NpJKW8R9+WN4Sc IlGZHtNpbtEVmTf3iEwZtLP1MLNaeotn8ZghR5076IbT1gat34GOUv+3yyossSmq8ppx C+TmL47j6riPN2/bt0AmTlDg7N79oYVp7C0VP2SFrY3pBZf68fWvnHszkAc7ycCURzNv T/jA== ARC-Authentication-Results: i=1; mx.google.com; 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 r39si13900220pld.70.2019.03.14.04.19.39; Thu, 14 Mar 2019 04:19:54 -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; 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 S1727135AbfCNLS4 (ORCPT + 99 others); Thu, 14 Mar 2019 07:18:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42528 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfCNLSz (ORCPT ); Thu, 14 Mar 2019 07:18:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 04DA380D; Thu, 14 Mar 2019 04:18:55 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E9A93F71D; Thu, 14 Mar 2019 04:18:51 -0700 (PDT) Date: Thu, 14 Mar 2019 11:18:49 +0000 From: Patrick Bellasi To: Peter Zijlstra 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: <20190314111849.gx6bl6myfjtaan7r@e110439-lin> 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> <20190313193916.GQ2482@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313193916.GQ2482@worktop.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-Mar 20:39, Peter Zijlstra wrote: > 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? Right, I see what you mean... strictly speaking histograms always do a floor aggregation. > > 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. Right... that's the point. We started with mapping to be able to track exact clamp values. Then we switched to linear mapping to remove the complexity of mapping, but we would like to still have the possibility to track exact numbers whenever possible. > 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? That's doable, otherwise maybe we can just add the above paragraphs to the changelog of this patch. But give your comment above I assume you prefer to split it out... just let me know otherwise. -- #include Patrick Bellasi