From patchwork Mon Jun 14 10:27:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 459805 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3161548jae; Mon, 14 Jun 2021 03:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCNgIchU5brTZVnYRyYahievFaB4BGTu29zrwwU/M1x0Pfm88puyvMG1s7V8pQgXlh75ko X-Received: by 2002:a17:906:3e8d:: with SMTP id a13mr14562561ejj.463.1623667498222; Mon, 14 Jun 2021 03:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623667498; cv=none; d=google.com; s=arc-20160816; b=mK9K6+kz4kTYDHT1pNJuYUZyULq1T/Csr4xnqmCMl4mHZegACieJwcCxjqWkIfQ3bQ DsxXCdU9dZ+yD6gmP/CDcQpVpAa3QrIRhyrTrEtlJE0uBCk3tDbekA9hM0o7aMeKZD7A LeRAy8zdbBvSI12ZLsKeu7q0XxiXysOsRqggo1i5LxaINin4xbWhuIvXdHMQSxRfu0OE gTjTfNVSTwes6kMYyTHHeZPyiQpH30eJf3OBzzXUdNDXDZDtiY1BgkVq9w8RM+KVuHdp R/D0HSQgeLtzVfFnG5SMXPWJfK7xNQ+wCYoyL7ntM+LgYN+qs+3NVHVb+C5vihETtY2r Izww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=szA8jD+f+svmpS6fXmOn5DDf1fewsD1y1XvrTpgOZVY=; b=PAoyVKkivRyFW/+ClgQCnFNA7Q4AX5mAI1bepREYK1eUErINq70DNAWsEQ/8ucHbF3 aOzDItgyLFWOBaLuNUq67vX4fFiImkb274WYYufTK6vwYhbVX3ocDG1Bw7YviId6CsDp HE11/xsASH2gX4XqdPXvRFxmxYyyhKyZ4i4GrtB26F57wd0O4t0opfzeZejRZ4RdIZNk mv8qzPzGjnVB28v/Df3/wmN54WYVmmiU9zktk4CLeFiflhJFnkvx8qVI+y//aAH/HG5N fROrG+Y1TXtbQxfs/wYs5ewymR4fugpboIYzImlmNvig4Xx3fRGs8B/+sfgRQSVhHZYE 0MKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="XySsZj/Y"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si10609433edc.458.2021.06.14.03.44.58; Mon, 14 Jun 2021 03:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b="XySsZj/Y"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233269AbhFNKq6 (ORCPT + 12 others); Mon, 14 Jun 2021 06:46:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234265AbhFNKou (ORCPT ); Mon, 14 Jun 2021 06:44:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 08F9561408; Mon, 14 Jun 2021 10:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623666985; bh=oby5e+s34eoWajW9Ai77zBtVrNbOCTegEtojlNx+RYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XySsZj/YWGH7GFCUexOCJZCSJHOhY4aPS4BuX+pFdr7HswhicbSN6mwqI+DRtCPL1 LreDEzk99AHHiCG3eWe/gAJsLepxCXjUJA9lCuhPeOdNpAwmFbUjGQ5RMvet1GSGWE rOklIwOu6p+eryVilX7hQ0c/9dhmTUP3CC59IdLY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Odin Ugedal , Vincent Guittot , "Peter Zijlstra (Intel)" Subject: [PATCH 4.19 54/67] sched/fair: Make sure to update tg contrib for blocked load Date: Mon, 14 Jun 2021 12:27:37 +0200 Message-Id: <20210614102645.595560769@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102643.797691914@linuxfoundation.org> References: <20210614102643.797691914@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vincent Guittot commit 02da26ad5ed6ea8680e5d01f20661439611ed776 upstream. During the update of fair blocked load (__update_blocked_fair()), we update the contribution of the cfs in tg->load_avg if cfs_rq's pelt has decayed. Nevertheless, the pelt values of a cfs_rq could have been recently updated while propagating the change of a child. In this case, cfs_rq's pelt will not decayed because it has already been updated and we don't update tg->load_avg. __update_blocked_fair ... for_each_leaf_cfs_rq_safe: child cfs_rq update cfs_rq_load_avg() for child cfs_rq ... update_load_avg(cfs_rq_of(se), se, 0) ... update cfs_rq_load_avg() for parent cfs_rq -propagation of child's load makes parent cfs_rq->load_sum becoming null -UPDATE_TG is not set so it doesn't update parent cfs_rq->tg_load_avg_contrib .. for_each_leaf_cfs_rq_safe: parent cfs_rq update cfs_rq_load_avg() for parent cfs_rq - nothing to do because parent cfs_rq has already been updated recently so cfs_rq->tg_load_avg_contrib is not updated ... parent cfs_rq is decayed list_del_leaf_cfs_rq parent cfs_rq - but it still contibutes to tg->load_avg we must set UPDATE_TG flags when propagting pending load to the parent Fixes: 039ae8bcf7a5 ("sched/fair: Fix O(nr_cgroups) in the load balancing path") Reported-by: Odin Ugedal Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Odin Ugedal Link: https://lkml.kernel.org/r/20210527122916.27683-3-vincent.guittot@linaro.org Signed-off-by: Greg Kroah-Hartman --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7512,7 +7512,7 @@ static void update_blocked_averages(int /* Propagate pending load changes to the parent, if any: */ se = cfs_rq->tg->se[cpu]; if (se && !skip_blocked_update(se)) - update_load_avg(cfs_rq_of(se), se, 0); + update_load_avg(cfs_rq_of(se), se, UPDATE_TG); /* * There can be a lot of idle CPU cgroups. Don't let fully