Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp841169imm; Fri, 1 Jun 2018 10:24:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIejniSL1+JzEe931ZlHrLfZWHzNQhAnk+xeF9GvQxWUMqbmnDMuz7cmCznblp0VdppgqbT X-Received: by 2002:a62:9b57:: with SMTP id r84-v6mr11855573pfd.157.1527873891934; Fri, 01 Jun 2018 10:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527873891; cv=none; d=google.com; s=arc-20160816; b=VM4nyZySNaeNxyBeLkDm382KH8EwTpWd9jFq9bDYWE0kxG9X4OAQ9FSASwo1f0ZYX3 wpbzl67kmc8DLvMTiAax4lF/A1fiPi9Zf6m3n2WSifjP/rltlpRJWY1Yln25j1L0Uly0 cKkGwRt52FFYsTfJKcRXUUeS1eNxMnB9LI6D4UC6jYiyiRDhK85CVn/zABnZJCJUr2O2 HsdJmBMhuWOpr/beEXPSlOnCm5p1KrR5qCGmLliSer5dLfw4KVR4wv9VsOIKpdQVGw9e a+/4a49vS4E5jgm2ys4C6gHH2AxA9psWr4WmAWZBhCOhQAtMWd95FOUq7DnQ55hhcXOh jqEQ== 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:arc-authentication-results; bh=RSSvVCM0PH9MSi68A+bk6Djo2vLknrNURakC7tkAEPc=; b=gTehGjuYvCPOuWDzg8PRquuDizUQeqNh2zOyqQqmVLi/z6H0f3lGXoyRSeBYpiF30b 8ASXIjSgJdGaYTj+r0EG9yJAC3jWnnBzFIfRA+farjRKsiTbRhHYYck9rr4grCHNE+fl gQxt1hrzXsiywe50CXUAVVLglHH293bPioNDXAUbC9QICoDtv0sd2lOUkLC7m2N5xQld mxmzgQsQ14igK1HHYWk4yI8aaZbsbonLp89JJAnzT+ZtDdr2QkoWcWVn0u0gJ0c4nvzZ FWavmpzCdJ0/iCQ3qh6fBYIlKpuiSEYAChm7DDS80OZlFu15tsvLBKjPwiuAKNgOhKtU 3YAA== 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 q19-v6si15448081pls.139.2018.06.01.10.24.36; Fri, 01 Jun 2018 10:24:51 -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 S1752308AbeFARYE (ORCPT + 99 others); Fri, 1 Jun 2018 13:24:04 -0400 Received: from foss.arm.com ([217.140.101.70]:56186 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeFARYE (ORCPT ); Fri, 1 Jun 2018 13:24:04 -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 845B21529; Fri, 1 Jun 2018 10:24:03 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 95AB13F53D; Fri, 1 Jun 2018 10:24:01 -0700 (PDT) Date: Fri, 1 Jun 2018 18:23:59 +0100 From: Patrick Bellasi To: Peter Zijlstra Cc: Juri Lelli , Quentin Perret , Vincent Guittot , mingo@kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com Subject: Re: [PATCH v5 03/10] cpufreq/schedutil: add rt utilization tracking Message-ID: <20180601172359.GN30654@e110439-lin> References: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> <1527253951-22709-4-git-send-email-vincent.guittot@linaro.org> <20180530164601.GC2174@e108498-lin.cambridge.arm.com> <20180531084607.GB17937@localhost.localdomain> <20180601162357.GT12180@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601162357.GT12180@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01-Jun 18:23, Peter Zijlstra wrote: > On Thu, May 31, 2018 at 10:46:07AM +0200, Juri Lelli wrote: > > On 30/05/18 17:46, Quentin Perret wrote: > > > > So I understand why we want to got to max freq when a RT task is running, > > > but I think there are use cases where we might want to be more conservative > > > and use the util_avg of the RT rq instead. The first use case is > > > battery-powered devices where going to max isn't really affordable from > > > an energy standpoint. Android, for example, has been using a RT > > > utilization signal to select OPPs for quite a while now, because going > > > to max blindly is _very_ expensive. > > > > > > And the second use-case is thermal pressure. On some modern CPUs, going to > > > max freq can lead to stringent thermal capping very quickly, at the > > > point where your CPUs might not have enough capacity to serve your tasks > > > properly. And that can ultimately hurt the very RT tasks you originally > > > tried to run fast. In these systems, in the long term, you'd be better off > > > not asking for more than what you really need ... > > > > Proposed the same at last LPC. Peter NAKed it (since RT is all about > > meeting deadlines, and when using FIFO/RR we don't really know how fast > > the CPU should go to meet them, so go to max is the only safe decision). > > > > > So what about having a sched_feature to select between going to max and > > > using the RT util_avg ? Obviously the default should keep the current > > > behaviour. > > > > Peter, would SCHED_FEAT make a difference? :) > > Hurmph... > > > Or Patrick's utilization capping applied to RT.. > > There might be something there, IIRC that tracks the max potential > utilization for the running tasks. So at that point we can set a > frequency to minimize idle time. Or we can do the opposite: we go to max by default (as it is now) and if you think that some RT tasks don't need the full speed, you can apply a util_max to them. That way, when a RT task is running alone on a CPU, we can run it only at a custom max freq which is known to be ok according to your latency requirements. If instead it's running with other CFS tasks, we add already the CFS utilization, which will result into a speedup of the RT task to give back the CPU to CFS. > It's not perfect, because while the clamping thing effectively sets a > per-task bandwidth, the max filter is wrong. Also there's no CBS to > enforce anything. Right, well... from user-space potentially if you carefully set the RT cpu's controller (both bandwidth and clamping) and keep track of the allocated bandwidth, you can still ensure that all your RT tasks will be able to run, according to their prio. > With RT servers we could aggregate the group bandwidth and limit from > that... What we certainly miss I think it's the EDF scheduler: it's not possible to run certain RT tasks before others irrespectively of they relative priority. -- #include Patrick Bellasi