Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5137979pxj; Wed, 26 May 2021 03:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU6h0v507TqeDJvoC1grCbFyHD0Lp/zF963PVtJQZljffDgjQMyzTAzuHsEoPtMqMGzKt8 X-Received: by 2002:a92:d342:: with SMTP id a2mr25965473ilh.11.1622026321092; Wed, 26 May 2021 03:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622026321; cv=none; d=google.com; s=arc-20160816; b=0XVpaZLzsmcb+j4gOorvdbmByocHXEmEsl7E4Uu8MaoVR+xy1rfAfLqufNWewhRnzr WR+7J/PQKIsTyTdQMi1b9KGoj0AKtAKt15gnxcnwCjl+61ZF+QduNHf+GhbEsZtcxkYf qtQF+g7R+Sk/WerwAnZTl14eJMraP2LXlIpMJU3xxTHYfwi/MTF0G4GPZrjsVwjFtu2H aKTZfcRqFqo1dXlxhDr86heCI7XSY78jmIWyLxOL5zVsSZ4DQweuNYrCj0lAU9XgevT6 p+erOSohhQGeuk6TxiBfzETLuS1eGGHKrbpj2vXbTiRaZVls6JNpoXSUJPi8VVKdPh+Y YteQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Rg+rDpurdjxV2F5rZP7XGzElnxCtpiLCvqo9sV8uwTg=; b=X+0zY9Se7mnCNB/M+4mnGRr2RDAboPhtN6XKjr1eiSVvmk31XFmdk7B8KyKuR8lgGm +VCBEW6qg5h/Kpmd64Vpc6I9XixlsL59Q4/C9r6kWAxwKGvO65swNEO6CN7QxDvMAMym ME86VN2OGiGbAy5FSCG89F3yCSYtbCQl9ag8IR8vdPhSw8bGAPxK7vHZxA1s9a8ij04E ZOYJdlTObCv+fRam8i+m2bToT8LHO2oblhlz5IOwQazK3jBXVdpF/vteFCRHYMRkNiuq T8y29oVZVv80GMqmjHdwjUcc/jGO83Vls47mGF69NTp23JgX+dCNIrIhPreUYX4gStmb 7IaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W7ACPeZH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si13764219ilv.39.2021.05.26.03.51.46; Wed, 26 May 2021 03:52:01 -0700 (PDT) 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=@linaro.org header.s=google header.b=W7ACPeZH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234191AbhEZKwY (ORCPT + 99 others); Wed, 26 May 2021 06:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233911AbhEZKwW (ORCPT ); Wed, 26 May 2021 06:52:22 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3BD4C06175F for ; Wed, 26 May 2021 03:50:49 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id a2so1813009lfc.9 for ; Wed, 26 May 2021 03:50:49 -0700 (PDT) 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=Rg+rDpurdjxV2F5rZP7XGzElnxCtpiLCvqo9sV8uwTg=; b=W7ACPeZH4mHcLJAc3onzzyQBdYO+yWJLn8U4NnEbfyyrevdPs7eGiBBaBJKjpIGiQQ t0UuGUteJrsDx740gUwtvZGCzAmQe+f2P9lMXvnR2pZ0CclcncvSyemLGLD818a9mmnA 1YVK5xLuVpMqGWyLJxbDWLw5/Y4iZYcv7T//+v9ZgBvQIoFjD7GwjZUKb6V+u5W9lv/k 66/euatPKQGBhPFmbWGGK2X5jSQA+02KH1FxLX10/YEkB8mqmLFcX6jsCUue+F4feyMF ILDDa6oBWVRIv4d5fM99VzmwD3TF8IBA3KLCzdevDS2wcI8/3A8KAqVPliFGDNIHX1ML hskw== 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=Rg+rDpurdjxV2F5rZP7XGzElnxCtpiLCvqo9sV8uwTg=; b=sjRMDzGsOW47Y/YCgqAHqVlWk59yL01dTKywaxc7yNV28bX1N3EzN4UH+Q01mNyG0T u/H4G9GCkZGkcIwxOiOgL9SltO00UFAzKaImRjaeCmd23qROQ8oMR0uStSGTJQjwjSJG a6zHMZw7eohTapSinUbV4sq2I+Xk0tTckbBM6+WOynLDGXgKG62dfR34DOJE9f7EbX2w r0wKSYLnEZpRLA6DqB6CaCeyh6EMzbyaRwyymo3xw4L5/VYTRlCLy2z2SUzpnmaiO9OT PPmNlZbOZCJTpCDPPg/1EtQhLbcoZKKvK1D4ltfvixnQsYay4zpS0XO3ICzfLhWj0vUw Ky3w== X-Gm-Message-State: AOAM530zzVNH6N+Bva71tDGMadYQLhW+FoC4Kwc6g4HRgjo95I+kO49D GykwgVlGMHvYCltggvqiJMXosRMTdRiQ418ErSqmqw== X-Received: by 2002:ac2:5111:: with SMTP id q17mr1727611lfb.277.1622026246960; Wed, 26 May 2021 03:50:46 -0700 (PDT) MIME-Version: 1.0 References: <20210518125202.78658-1-odin@uged.al> <20210518125202.78658-2-odin@uged.al> In-Reply-To: From: Vincent Guittot Date: Wed, 26 May 2021 12:50:35 +0200 Message-ID: Subject: Re: [PATCH 1/3] sched/fair: Add tg_load_contrib cfs_rq decay checking To: Odin Ugedal Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , "open list:CONTROL GROUP (CGROUP)" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 May 2021 at 16:30, Vincent Guittot wrote: > > On Tue, 25 May 2021 at 12:34, Odin Ugedal wrote: > > > > Hi, > > > > tir. 25. mai 2021 kl. 11:58 skrev Vincent Guittot : > > > Could you give more details about how cfs_rq->avg.load_avg = 4 but > > > cfs_rq->avg.load_sum = 0 ? > > > > > > > cfs_rq->avg.load_sum is decayed and can become null when crossing > > > period which implies an update of cfs_rq->avg.load_avg. This means > > > that your case is generated by something outside the pelt formula ... > > > like maybe the propagation of load in the tree. If this is the case, > > > we should find the error and fix it > > > > Ahh, yeah, that could probably be described better. > > > > It is (as far as I have found out) because the pelt divider is changed, > > and the output from "get_pelt_divider(&cfs_rq->avg)" is changed, resulting > > in a different value being removed than added. > > ok so IIUC, it happens during the adding/removing/propagating > entities' load in the cfs_rq. > > > > > Inside pelt itself, this cannot happen. When pelt changes the load_sum, it > > recalculates the load_avg based on load_sum, and not the delta, afaik. > > > > And as you say, the "issue" therefore (as I see it) outside of PELT. Due to > > how the pelt divider is changed, I assume it is hard to pinpoint where the issue > > is. I can try to find a clear path where where we can see what is added > > and what is removed from both cfs_rq->avg.load_sum and cfs_rq->avg.load_avg, > > to better be able to pinpoint what is happening. > > > > Previously I thought this was a result of precision loss due to division and > > multiplication during load add/remove inside fair.c, but I am not sure that > > is the issue, or is it? > > I don't think the precision looss is the problem because > adding/removing load in fair.c could truncate load_sum but it stays > sync with load_avg. I will have a llo to see if i can see something > weird I have added a trace in cfs_rq_is_decayed() but I'm not able to reproduce a situation where load_sum == 0 but not load_avg even with the script in the cover letter > > > > > If my above line of thought makes sense, do you still view this as an error > > outside PELT, or do you see another possible/better solution? > > > > Will investigate further. > > Thanks > > > > > Thanks > > Odin