Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1920223imm; Thu, 7 Jun 2018 02:25:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKqnlv8Y64FREkf3cldM5LVv+7I1B8vbjWmTkuY9icEfZRL8TGODbv1UCAqj9KY2mvenOuR X-Received: by 2002:a62:221a:: with SMTP id i26-v6mr1074828pfi.240.1528363516173; Thu, 07 Jun 2018 02:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528363516; cv=none; d=google.com; s=arc-20160816; b=pr8ngAXFY6Buct34pLIw2r3vALh9x6+pjh7jDW8MXzG3HJu1I9hWxDrDlXAiaU0iYl y5JJrRYBXX8PJVg3pndXOVdfsFTPMTJKU6wvLIADnHqdcig0wRT2lBhirFlHBmJVGYG4 UaEFvEZrTql7KFSlNIgzyvqVleRam3CT7RPYbwkwzV7fRJoeOeTPD/JKYwYCt8eZIZeN /SAVywavWcyNzXid3C24EvP85PDBwnFC6FPdDHFMd+7jHXKQhd8Bvj2URz0Twc0ypFbV rEnqAVcsuycRX+3G7YlmC9iHpY24uUd2rdTyA9D357faxv7mDwWSX7sluU8Q2tXwn1Bk Gs8w== 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=uDyCj1zwDinaneDpYkZRxFLCt4M4kclzsp71Xe5ZP2s=; b=g9JHSXFqRKIttPcro9leHxUwK2+dLwJu64spiDFSsp8GnmEM5IgG8aO2o48pkYmJ0A N9fQuRAOE/grjkwe7BDJm5vMOmZnvvlUzade4wRtO4vyGAoLxs6+zw3LPisnr9L5lFO+ Z9Jqi+cM/dfaJ6OL2w32v2TYn0VR28ulZjKOckNYTNwrPVOkOdT77pA9frtCs+MssdnV 4Ws0IFsSgj6UorAiH0Fobex0+0ox+5WjlCjyYPKitqr96TgA86ucUpcwNApTfVPJRGlB A1qH7W/WnZvDC30V6k4F/oox4G/V56cJayRsaFfPv0RYXT7dcigXlOtI6kCP8RCfMJpK PFaQ== 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 o10-v6si13955421pll.158.2018.06.07.02.25.01; Thu, 07 Jun 2018 02:25:16 -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 S932703AbeFGIZ2 (ORCPT + 99 others); Thu, 7 Jun 2018 04:25:28 -0400 Received: from foss.arm.com ([217.140.101.70]:48138 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932240AbeFGIZ0 (ORCPT ); Thu, 7 Jun 2018 04:25:26 -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 F1F7480D; Thu, 7 Jun 2018 01:25:25 -0700 (PDT) Received: from e108498-lin.cambridge.arm.com (e108498-lin.cambridge.arm.com [10.1.210.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCE913F59D; Thu, 7 Jun 2018 01:25:23 -0700 (PDT) Date: Thu, 7 Jun 2018 09:25:22 +0100 From: Quentin Perret To: luca abeni Cc: Claudio Scordino , Juri Lelli , Vincent Guittot , Peter Zijlstra , Ingo Molnar , linux-kernel , "Rafael J. Wysocki" , Dietmar Eggemann , Morten Rasmussen , viresh kumar , Valentin Schneider Subject: Re: [PATCH v5 00/10] track CPU utilization Message-ID: <20180607082522.GM10870@e108498-lin.cambridge.arm.com> References: <20180605105721.GA12193@e108498-lin.cambridge.arm.com> <20180605121153.GD16081@localhost.localdomain> <20180605130548.GB12193@e108498-lin.cambridge.arm.com> <20180605131518.GG16081@localhost.localdomain> <20180605140101.GE12193@e108498-lin.cambridge.arm.com> <20180605141317.GJ16081@localhost.localdomain> <6c2dc1aa-3e19-be14-0ed8-b29003c72e61@evidence.eu.com> <20180606132046.GC10870@e108498-lin.cambridge.arm.com> <20180606230536.2c0ae587@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180606230536.2c0ae587@nowhere> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Luca, On Wednesday 06 Jun 2018 at 23:05:36 (+0200), luca abeni wrote: > Hi, > > On Wed, 6 Jun 2018 14:20:46 +0100 > Quentin Perret wrote: > [...] > > > However, IMHO, these are corner cases and in the average case it is > > > better to rely on running_bw and reduce the CPU frequency > > > accordingly. > > > > My point was that accepting to go at a lower frequency than required > > by this_bw is fundamentally unsafe. If you're at a low frequency when > > a DL task starts, there are real situations where you won't be able > > to increase the frequency immediately, which can eventually lead to > > missing deadlines. Now, if this risk is known, has been discussed, > > and is accepted, that's fair enough. I'm just too late for the > > discussion :-) > > Well, our conclusion was that this issue can be addressed when > designing the scheduling parameters: > - If we do not consider frequency scaling, a task can respect its > deadlines if the SCHED_DEADLINE runtime is larger than the task's > execution time and the SCHED_DEADLINE period is smaller than the > task's period (and if some kind of "global" admission test is > respected) > - Considering frequency scaling (and 0-time frequency switches), the > SCHED_DEADLINE runtime must be larger than the task execution time at > the highest frequency > - If the frequency switch time is larger than 0, then the > SCHED_DEADLINE runtime must be larger than the task execution time > (at the highest frequency) plus the frequency switch time > > If this third condition is respected, I think that deadline misses can > be avoided even if running_bw is used (and the CPU takes a considerable > time to switch frequency). Of course, this requires an over-allocation > of runtime (and the global admission test has more probabilities to > fail)... Ah, right, this third condition should definitely be a valid workaround to the issue I mentioned earlier. And the runtime parameter is already very much target-dependent I guess, so it should be fine to add another target-specific component (the frequency-switching time) to the runtime estimation. And, if you really need to have tight runtimes to fit all of your tasks, then you should just use a fixed frequency I guess ... At least the current implementation gives a choice to the user between being energy-efficient using sugov with over-allocated runtimes and having tighter runtimes with the performance/powersave/userspace governor, so that's all good :-) Thank you very much, Quentin