Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3738629ybk; Tue, 19 May 2020 11:46:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8Rs8VsMqEGp5jT5UFEl5kQlViuhf9XdQjMrocXT1V+WR3mKp1cWGGEJ4I63/Rj1d1ZSVn X-Received: by 2002:a17:906:1443:: with SMTP id q3mr511696ejc.325.1589913983129; Tue, 19 May 2020 11:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589913983; cv=none; d=google.com; s=arc-20160816; b=Yiu3yOrpJdQiwJHbgZTDo/7mMo9tRQi2KBKkut0sjysSgf8tsgO56COxzPL9cJMVxZ YuJleXu9NRJ8dprPMn6ENjmFJgOrgz/XoZCXSINALDvYXyYVCpmHuoumSwSYeq412Fxa QUPV6Zl8PZqGc5PoUmcU+vyFhKxq5xalYvMyyXOzdEzzXQmBQRilVHFe1OldV5Mj0Aej reLLgAXVvnFILM3LO4rZJuPyP2nt4tCIL7f1qJkt/h8dmSF6w+08EOyNOrIcFBC697wI i5T8RQ6NYiKp7lz7CJVOqx9/Pnm7eBIVMfV8XMASjw/3ZKTu1UZTleEFS8mHQAza3qpR kvKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=BiI5x8wTnGmnusCbm/idBDnhnP0ij1NjbbiVthXm/Qk=; b=dj9jd4UmnktcC6+K4FT9pvITZkUgCR4fVPpY0Iv51CTBca/m2iNHhwF7j7+SvQSKvn JPCfzmLu0wTTwS4aCF/tmbRQKQH0blb5pkIor27xOJTYwSXthW+uUTy8UBBwGwQTUgip 6cneCRYfU2xYaqeOUOvBcDbMv+9ykfWOE70iyMz/7WHEZysz2PbWT3SInQ69YdDFWcFz RPLECghrUzFn5D5tYgDBZZbfQzUvLMDpZyFwdX53G8aKervLFyrkwErb8EDntUqZr3QP 9Zrsh0F9nTtpWm6XrELk/6kYIy8g6QiDgIxSUV2L8ff3npc3jUa5TJ1VKGWTeUK9Pm+t mi8w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p59si181227edd.241.2020.05.19.11.45.59; Tue, 19 May 2020 11:46:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbgESSo0 (ORCPT + 99 others); Tue, 19 May 2020 14:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgESSoV (ORCPT ); Tue, 19 May 2020 14:44:21 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE961C08C5C0; Tue, 19 May 2020 11:44:20 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jb7Dq-0006c9-7d; Tue, 19 May 2020 20:44:14 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id CED5A1C0178; Tue, 19 May 2020 20:44:13 +0200 (CEST) Date: Tue, 19 May 2020 18:44:13 -0000 From: "tip-bot2 for Phil Auld" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/fair: Fix enqueue_task_fair() warning some more Cc: Vincent Guittot , Phil Auld , "Peter Zijlstra (Intel)" , Dietmar Eggemann , x86 , LKML In-Reply-To: <20200512135222.GC2201@lorien.usersys.redhat.com> References: <20200512135222.GC2201@lorien.usersys.redhat.com> MIME-Version: 1.0 Message-ID: <158991385371.17951.7641026996836626730.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: b34cb07dde7c2346dec73d053ce926aeaa087303 Gitweb: https://git.kernel.org/tip/b34cb07dde7c2346dec73d053ce926aeaa087303 Author: Phil Auld AuthorDate: Tue, 12 May 2020 09:52:22 -04:00 Committer: Peter Zijlstra CommitterDate: Tue, 19 May 2020 20:34:10 +02:00 sched/fair: Fix enqueue_task_fair() warning some more sched/fair: Fix enqueue_task_fair warning some more The recent patch, fe61468b2cb (sched/fair: Fix enqueue_task_fair warning) did not fully resolve the issues with the rq->tmp_alone_branch != &rq->leaf_cfs_rq_list warning in enqueue_task_fair. There is a case where the first for_each_sched_entity loop exits due to on_rq, having incompletely updated the list. In this case the second for_each_sched_entity loop can further modify se. The later code to fix up the list management fails to do what is needed because se does not point to the sched_entity which broke out of the first loop. The list is not fixed up because the throttled parent was already added back to the list by a task enqueue in a parallel child hierarchy. Address this by calling list_add_leaf_cfs_rq if there are throttled parents while doing the second for_each_sched_entity loop. Fixes: fe61468b2cb ("sched/fair: Fix enqueue_task_fair warning") Suggested-by: Vincent Guittot Signed-off-by: Phil Auld Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20200512135222.GC2201@lorien.usersys.redhat.com --- kernel/sched/fair.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 02f323b..c6d57c3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5479,6 +5479,13 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags) /* end evaluation on encountering a throttled cfs_rq */ if (cfs_rq_throttled(cfs_rq)) goto enqueue_throttle; + + /* + * One parent has been throttled and cfs_rq removed from the + * list. Add it back to not break the leaf list. + */ + if (throttled_hierarchy(cfs_rq)) + list_add_leaf_cfs_rq(cfs_rq); } enqueue_throttle: