Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1161303imu; Wed, 28 Nov 2018 05:38:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/X9HVi23HvsaDejoIvXd1YeOxpAWkOdpZUegFtGzwNUKWdQr0QQRG8DATjwxofHOCY3pJsS X-Received: by 2002:a63:f34b:: with SMTP id t11mr33184938pgj.341.1543412286408; Wed, 28 Nov 2018 05:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543412286; cv=none; d=google.com; s=arc-20160816; b=j0Gyj8TQIxAUpu2Spunxmsz7PLfjOOgDSSF5zNGDLCKEsuJ+abjUaqjXQCdPtQ2Rl7 ZQM+JrDi6bEX55aO3WhMrcR2B844WmsP3hP+OCQHU7L0wBS4gePyXl3qsCKpA+wrAMj/ mD6RGRNVp0hb91b+tNphgBSM5mSS1zpbtZMN9oW2XIZ2Ad3YzuqB4yk0O/q6/QuXLNsu Ov0lul/FNwtvbYdM/zfAVRulsQ1aT9hXqkzFKoLoUgyT8Iho89PDmGwGbr/pfg3s/W6f JGgdXNTY55MBYWgtKSP2+uyLLt2c2BeJWr3J+xLYOPQIV4C+Ry3ag2UdJ77yAHg/yctQ EkXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=13S8GW6ail1pyySMV3j2ahSI/y8rsQwLofFeF4iD3KM=; b=qVyZYNeKnVFngoLMRK+8xW9pEXtlUePYlcDGG8FonoB7MSLtQVHHOT0Hz3Z3pBHEHV cd3jc7o447H5BSpXXakdXxEx4Aprq0VPLEISPcD2NgHOztHseyAf+iG++VAwS1IgNE9Z Fa7xjhH7JsBiioM/6u7TETkpeC0E2YS5usXpEDmFrk4/8JP+Y/E05kjichDHesgmYyE9 8Zs+EqVKALDUY/kVFYHaduyoWUb7eX+3oyZa+8OsoLf8F7DeOCCcDEf1B86x9Cgr5iH2 VIepleeY7SBsA/l3L+RTTKkCJe2DsxOWBY1Oswq30ZvlehiwoAZubLByAww96eimYfEP IyJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hujK7Uf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si8391390pli.50.2018.11.28.05.37.49; Wed, 28 Nov 2018 05:38:06 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=hujK7Uf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728387AbeK2Agx (ORCPT + 99 others); Wed, 28 Nov 2018 19:36:53 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:46423 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbeK2Agx (ORCPT ); Wed, 28 Nov 2018 19:36:53 -0500 Received: by mail-io1-f68.google.com with SMTP id v10so14325213ios.13 for ; Wed, 28 Nov 2018 05:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=13S8GW6ail1pyySMV3j2ahSI/y8rsQwLofFeF4iD3KM=; b=hujK7Uf4lkDxVfIZJQEiPwyLyPUNcisAuntI6KMIp7tg5xgro/LKDjvj9TroXYvr7o Z2DSmngix4lNK6xRozWB4JisEfQd0+JGCEPB+keKfy8eOtlS1U+D0hAG0miV1xfZLd0K 1KkqAP5SIF4H/nEMvMCTs5yu/N82fwS5AvBTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=13S8GW6ail1pyySMV3j2ahSI/y8rsQwLofFeF4iD3KM=; b=kGMmDQnANE9uboPqRinWcSnhAxK/OJ40hNBpw3PqLBkz8DsO6FuEeoTpdJObTmzjgW GnicFGQYQrFQ5QB8Kbo7WUeHjXnH09lH+gSHsb8H2v3AG59swStAyxVYrmrh231qD4jZ z0qinKQXblPPwrdIj8tvhJblKEseaJ5dYZiDg2eNVPLxCwOu9YQEbxnTJbA4n+xb1mUa PiKd42Y3wVpMTHCF4FCMS2QleV10HzdqW9PdtFYhZW4HuXs8WFCfaDUyhlGzeUpiAn4k eaC3tn8CWL3wfXnaELKZKSSomQtD/k91zlCRWYQb/XO/2nlcZrAJZUE1/BGF5PgQgIEU m1+g== X-Gm-Message-State: AA+aEWb3Yk9+WJhQmPxvuhvWMoPlgfxBbrchEFaUttlZO23e3W3DDTlV aHBCEEuAT4m8SL6hB2KB3V4bHcul2Py+GxocE8GkIg== X-Received: by 2002:a6b:6b0d:: with SMTP id g13mr27228207ioc.18.1543412111911; Wed, 28 Nov 2018 05:35:11 -0800 (PST) MIME-Version: 1.0 References: <1542711308-25256-1-git-send-email-vincent.guittot@linaro.org> <1542711308-25256-3-git-send-email-vincent.guittot@linaro.org> <20181128100241.GA2131@hirez.programming.kicks-ass.net> <20181128115336.GB23094@e110439-lin> In-Reply-To: From: Vincent Guittot Date: Wed, 28 Nov 2018 14:35:00 +0100 Message-ID: Subject: Re: [PATCH v7 2/2] sched/fair: update scale invariance of PELT To: Patrick Bellasi Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , "Rafael J. Wysocki" , Dietmar Eggemann , Morten Rasmussen , Paul Turner , Ben Segall , Thara Gopinath , pkondeti@codeaurora.org, Quentin Perret , Srinivas Pandruvada Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Nov 2018 at 14:33, Vincent Guittot wrote: > > On Wed, 28 Nov 2018 at 12:53, Patrick Bellasi wrote: > > > > On 28-Nov 11:02, Peter Zijlstra wrote: > > > On Wed, Nov 28, 2018 at 10:54:13AM +0100, Vincent Guittot wrote: > > > > > > > Is there anything else that I should do for these patches ? > > > > > > IIRC, Morten mention they break util_est; Patrick was going to explain. > > > > I guess the problem is that, once we cross the current capacity, > > strictly speaking util_avg does not represent anymore a utilization. > > > > With the new signal this could happen and we end up storing estimated > > utilization samples which will overestimate the task requirements. > > > > We will have a spike in estimated utilization at next wakeup, since we > > use MAX(util_avg@dequeue_time, ewma). Potentially we also inflate the EWMA in > > case we collect multiple samples above the current capacity. > > TBH I don't see how it's different from current implementation with a > task that was scheduled on big core and now wakes up on little core. > The util_est is overestimated as well. > > But I'm fine with adding your proposal on to on the patchset s/on to on/on top of/ > > > > > So, a possible fix could be to avoid storing util_est samples if we > > end up with a utilization above the current capacity. > > > > Something like: > > > > ----8<--- > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index ac855b2f4774..93e0cf5d8a76 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -3661,6 +3661,10 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) > > if (!task_sleep) > > return; > > > > + /* Skip samples which do not represent an actual utilization */ > > + if (unlikely(task_util(p) > capacity_of(task_cpu(p)))) > > + return; > > + > > /* > > * If the PELT values haven't changed since enqueue time, > > * skip the util_est update. > > ---8<--- > > > > Could that work ? > > > > Maybe using a new utility function to wrap the new check. > > > > -- > > #include > > > > Patrick Bellasi