Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1116564pxb; Fri, 20 Nov 2020 01:18:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCWfrYmV5jZLVqjZ8sQrwyfp/G84ihlDJTyzC1c1XGm+Y9o7D8EusPyJrMyMA7ubIkeYEN X-Received: by 2002:a17:906:7016:: with SMTP id n22mr33688551ejj.402.1605863896561; Fri, 20 Nov 2020 01:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605863896; cv=none; d=google.com; s=arc-20160816; b=nZWiZXbbJpW/RnmofhEPHjR62c/nMvfyqBCbIxxKuwEOxVlTCNwOq9Z/TPqtnDo12+ U+Za+wPZ8Br+OY1jWM1tXm1c4TOm5IREw/Ksq23fQcyJcna51jexygWX3qE8i/MH5ni6 DaNyFfTa2JaAYHAHjRnBqoNfa0gUsLY6qDXnydnVDRCU7B0GsBp0EFKOn9cO4dUoDzqh ntTPpbxxQH7r0hXp6OS32qSrek+9QXK3yx4WOgoLcya3Y60qRvOzEZCpCru5ejjO9BQ5 Gm1ReGb0X1uMiOHE9QZ4TLU8BERPGnDxnXFhulcUIe0q5+0lXofahExeWqmXzPFuaXWI X7KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kvwCEr0uCbeNJuRr3wMhu/1mQPVgkP6nHNyJs6HnJ4c=; b=GeNJzfbPcJLnO5Qyk1vJ0Yaqns0nwEWOKjuirfLJt7zZIbSHptKAc4V+YVw/PumRm8 gMUsNS04sxQ5KNwSZ9hvXC62RFAGh0v3UZb93xm/3yiBuSdT4IcvD7L9l+xf+Tubr7xU GnZv/NzEP2jpSKWOyp4YCmfk/3QHNrMJFGVN3oF5OBtKiBkb/CVDt77WXKmdDxPESc2J NKCrUzG+9qiytg11xVyOrvrJpCNhgkMKxAl2alLDlww+TICtBOad8siJO7et9f4LRr2p PAkbdxHtTdJPVs81LCjZFkyUrPb0I4G+NSeQuGhOpTeVioJzsz44pfgrFijdVuq/jb4B z5WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VSs5QW9g; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si1448764edw.337.2020.11.20.01.17.53; Fri, 20 Nov 2020 01:18:16 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=VSs5QW9g; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727285AbgKTJOD (ORCPT + 99 others); Fri, 20 Nov 2020 04:14:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbgKTJOC (ORCPT ); Fri, 20 Nov 2020 04:14:02 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE082C0613CF for ; Fri, 20 Nov 2020 01:14:01 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id c198so7766279wmd.0 for ; Fri, 20 Nov 2020 01:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kvwCEr0uCbeNJuRr3wMhu/1mQPVgkP6nHNyJs6HnJ4c=; b=VSs5QW9gbqS90bef06xygx1KkfVuPGvFL3ry+8zEzh7l/o0/s94qUVyMu7s2BlbpYz tGFX/aZ6ccbllDJUa3Nx9Tdy67prUS3nEqkmhdKnE3n2MOEZ0FO5pQS1MZ0IJxeTk05f rKgRzKlY6k0aFGFYG2vTrl/heq1SSKmo/aD+/b7UKOPS/htbdYrvDvyJgSnQm5MZpG52 8kaNcdXQmYPXM4i33Ovoq4P8MIAU1Uv1mJDSqSMvBmiRnwc7tjn6xK2Qp+WyorPdNHBF IKXZNS1WSVhoLh2rNtTTRc91SmfxhEKX8cfSLCS8VIBBDE8NNWFyYCkn00rb6/+SYEcv nKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kvwCEr0uCbeNJuRr3wMhu/1mQPVgkP6nHNyJs6HnJ4c=; b=KlpU6LFpVOe50JIsh3ZGB7W+75fgZYBIe4SjFwAkE3JhXm9IQqcKcjHUwssLwCbLBB SxFh36HQVARxrayGmfyhTQ5z+m9o+VOf66OPd2czUyLblaGUQ4P+JVcJNhsdH7sxDp78 8X7fs3gt/UQkdNhmpVP2cDzyLJpuOnDt1rtxzVBLn78dvZtTiy4QTWajKE2Tvw3bVTXn LgK3mQVeIQsGl855Nsa2aGGiRVlpxv8GhxaFKUqWYedWubM97W0SKixO1i3FFckMaxVY 9xDpca128996Fxt6NMcHk79EmZtjxVJa3mtsdX7odRSaZEDqU9eJiT2E46Lh1iwj+xZY VELw== X-Gm-Message-State: AOAM530aUvcwUROn1VuwQTiR8G2g2G9XzIRac7Z91qxxsx9KT/P+wcAo 9djihSOScNvO9pKBtL2OIsiedw== X-Received: by 2002:a7b:c309:: with SMTP id k9mr8587785wmj.14.1605863640397; Fri, 20 Nov 2020 01:14:00 -0800 (PST) Received: from google.com ([2a00:79e0:d:210:f693:9fff:fef4:a7ef]) by smtp.gmail.com with ESMTPSA id 34sm4801578wrq.27.2020.11.20.01.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 01:13:59 -0800 (PST) Date: Fri, 20 Nov 2020 09:13:56 +0000 From: Quentin Perret To: Peter Zijlstra Cc: "Rafael J. Wysocki" , Ingo Molnar , Thomas Gleixner , Vincent Guittot , Morten Rasmussen , dietmar.eggemann@arm.com, patrick.bellasi@matbug.net, lenb@kernel.org, linux-kernel@vger.kernel.org, valentin.schneider@arm.com, ionela.voinescu@arm.com, viresh.kumar@linaro.org Subject: Re: [RFC] Documentation/scheduler/schedutil.txt Message-ID: <20201120091356.GA2653684@google.com> References: <20201120075527.GB2414@hirez.programming.kicks-ass.net> <20201120085653.GA3092@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120085653.GA3092@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 20 Nov 2020 at 09:56:53 (+0100), Peter Zijlstra wrote: > On Fri, Nov 20, 2020 at 08:55:27AM +0100, Peter Zijlstra wrote: > > - In saturated scenarios task movement will cause some transient dips, > > suppose we have a CPU saturated with 4 tasks, then when we migrate a task > > to an idle CPU, the old CPU will have a 'running' value of 0.75 while the > > new CPU will gain 0.25. This is inevitable and time progression will > > correct this. XXX do we still guarantee f_max due to no idle-time? The sugov_cpu_is_busy() logic should mitigate that, but looking at it again I just realized we don't apply it to the 'shared' update path. I can't recall why. Anybody? > Do we want something like this? Is the 1.5 threshold sane? (it's been too > long since I looked at actual numbers here) > > --- > > diff --git a/kernel/sched/features.h b/kernel/sched/features.h > index 68d369cba9e4..f0bed8902c40 100644 > --- a/kernel/sched/features.h > +++ b/kernel/sched/features.h > @@ -90,3 +90,4 @@ SCHED_FEAT(WA_BIAS, true) > */ > SCHED_FEAT(UTIL_EST, true) > SCHED_FEAT(UTIL_EST_FASTUP, true) > +SCHED_FEAT(UTIL_SAT, true) > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 590e6f27068c..bf70e5ed8ba6 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -2593,10 +2593,17 @@ static inline unsigned long cpu_util_dl(struct rq *rq) > return READ_ONCE(rq->avg_dl.util_avg); > } > > +#define RUNNABLE_SAT (SCHED_CAPACITY_SCALE + SCHED_CAPACITY_SCALE/2) > + > static inline unsigned long cpu_util_cfs(struct rq *rq) > { > unsigned long util = READ_ONCE(rq->cfs.avg.util_avg); > > + if (sched_feat(UTIL_SAT)) { > + if (READ_ONCE(rq->cfs.avg.runnable_avg) > RUNNABLE_SAT) > + return SCHED_CAPACITY_SCALE; > + } > + > if (sched_feat(UTIL_EST)) { > util = max_t(unsigned long, util, > READ_ONCE(rq->cfs.avg.util_est.enqueued)); Need to do the math again, but it's an interesting idea and would solve a few things (e.g. reset the overutilized flag because of the 'gap' left by a migration and such) ... Thanks, Quentin