From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00DE2C2B9F8 for ; Tue, 25 May 2021 14:31:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB80B613E6 for ; Tue, 25 May 2021 14:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233982AbhEYOdM (ORCPT ); Tue, 25 May 2021 10:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233965AbhEYOcl (ORCPT ); Tue, 25 May 2021 10:32:41 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43816C061756 for ; Tue, 25 May 2021 07:31:09 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id a4so23588025ljd.5 for ; Tue, 25 May 2021 07:31:09 -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=uIo7/iOcEYFUfIFZkRcOL5riddbVvAIMJ8wGs/EdkRc=; b=F4A75JkMsGy+mU4xkQ+hrRir1o9AbYLExHPfcQfFnUXIO6DE/5641VeHIyAalgivCo N/kqbRtpIl8KaXs/NPtXGmOEUNdo8CVx47T8HCgN+GKM0k1wSbGnmY0ybIGqTJxaxmhD Oku336dpO2ktfatK/DKwpF72MdpjA+uz3NyTix8H0hCjxR2a3OHIXjMz9SZvMKgzJua6 t4/+hW/krEvXJkvFk+i8+iI3iXeYAnNSgdL5bbX0zDLCbpg08A7YMYpfM/RHIQ6wv+eA L4ZgOJslSk1zsLpXvaxJ02QWV5j1YVGO8LXSADULytLj7TtLIVSxtXEsfJoQ0k9UlqE9 FemA== 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=uIo7/iOcEYFUfIFZkRcOL5riddbVvAIMJ8wGs/EdkRc=; b=m/JQcxle+NPkThChIWV832d55VzbKHtgC7BloZbXvleVWVmzZffFq8O0gRt/5P4YZR 9jgBQOxZrIJs3tDjNv1fx23z3Quu6835H8r0pfnU6qL6eZ/J1rR/nE2DjLuwBo8MLJ/S SK1gukBW6Gm+CAw6wzSCKoTHH85cXDAplMHBNxV48Hy8m9HfxhbtVyTqxbM91cXAuhV1 SMSnpTbkMayUaYvkMR+3vAXngk37ufxV4uS1n5C7zBbnktOv5wXbe53sFmGiHR2tgpaI GNoJ3ld5WbWlTelQ8zd3eI1JNpM7B6/CgPj+uosg2W9+rmtPj7uwpi1pXmt9N+1jbS7B /Jmg== X-Gm-Message-State: AOAM531VdK5uctOM6z6ve0Cl8Uv/HnjEZCudICWgztmnpwW7wy74ZevS YEsG3Sp8OkhATyX7wqFEAyD5gRw5MuFgyCpS2ftS8A== X-Google-Smtp-Source: ABdhPJzflWL8WFPLlqF2nqn88esxiz7UOtN3WY7NEPE9rRP/KyQ0T/B/OYaUBhxDA8Z6jvZO0I2929MAH7rE8RMqI2o= X-Received: by 2002:a2e:8557:: with SMTP id u23mr20793221ljj.221.1621953067483; Tue, 25 May 2021 07:31:07 -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: Tue, 25 May 2021 16:30:56 +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 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 > > 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