Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2744208ybk; Tue, 12 May 2020 07:09:06 -0700 (PDT) X-Google-Smtp-Source: APiQypKqWQcaDZ1Q0uQ5pED4J/lgK6CiMqEZ3iYNRHT1UgOmQx7UqGHr7VtfKagj8LjbJ4l3oUBr X-Received: by 2002:aa7:d60a:: with SMTP id c10mr18687409edr.66.1589292546673; Tue, 12 May 2020 07:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589292546; cv=none; d=google.com; s=arc-20160816; b=gpLkXsQAon7NogYh0JSetwyDURhnie5GSOsbYoVRO5CVKUSyJolClujHcyj9Lvldkw GWydItTMBrAUBJwaNq1W+GlUf6xZ4RKkdejUIhSmVZT46wJAG44nXnncFupbScIbs28d 6IgSxpHna5glVqHb+8KBEqb+dhMpjHVaSl7rGr3RaTvXjGfxA4kjZo9bY1lkfas54y0C szm4tcOYBHzBB6Qd42NPAh3h8GWCZP+a/PSU5jFzJwj5NoEle8e0Ul7rlH0AS0yoizC9 6NhwhSui4nxdxMRbTnlVtYkEi4cE0/1qp/T2+3dZ6C1UGq/FN7Vj/spUP0RFdYOCL74U 4VfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pKb7TBlLHJxHT49BEZUwW80DII8+mBmNWxxoWsxXBxI=; b=PjDttiwUl6EpWrYSpzrN9dl64EAVtQo8A9eUZEbhWPqDwa4lNfg49ygTTBWiA9t5DP M3bDNP/vin4g7Mpt84Nc6jXepnxsUvWV9pIONtwIYwWOJdVW+khh3kBb4aNAMHJJ9BYJ OLYhXKPKLmEbn5Z/5A7fWGi53TVivuT7R2eKPZ0aFXbcHWAOJVkhGYsc4llJehRibyBJ Mx/YPlzM4Q48XaqM3CcVKU88Sp/0BlwyOSjfhLvSO+UVLgtjRTrf2kPek4JEbS9ffQki uKRawQmMfQpzPhGS64x1Ka1GTc5IkNsicUcDSsqip4UH7fdbt7Qq+UP34FKqF6dPsVWP nFHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LCwr5v5l; 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 g23si5937936edm.358.2020.05.12.07.08.43; Tue, 12 May 2020 07:09:06 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LCwr5v5l; 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 S1729893AbgELOG7 (ORCPT + 99 others); Tue, 12 May 2020 10:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728283AbgELOG7 (ORCPT ); Tue, 12 May 2020 10:06:59 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1883C061A0C for ; Tue, 12 May 2020 07:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pKb7TBlLHJxHT49BEZUwW80DII8+mBmNWxxoWsxXBxI=; b=LCwr5v5lNheIrqZTGzNsVqnRkd ZUGQj6kgJuWhpLZBrclbQ/F/npSJSXv3dDO413T6PfTvIWGCGtM9EVH7mpk0EKkyz3fHCfJSJQAVl 2tJuZOFNwyoDQpooxdbGrlf0KfCv3bCw/cxlYz5N5UbLnLQBCrFMk7JVLf/msluUOTHSmVCQGOtSD XztDM/sqjJFP/gtOHKFYDNv0LH7qTLt19iB3dTi/FEJbbKnzoyaownBqdNPrIhbuTmM7rAAHwG9kI cB3+Q44ZMUF93DONv11zeB+Zi8jfdTP7fJWsuy+VVvwdfXE9hoQ6AiUXM/yrZV+T/2Bg3y2h7Dn1+ x5DsroYw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYVYa-0003uG-6G; Tue, 12 May 2020 14:06:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2A7083011E6; Tue, 12 May 2020 16:06:50 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1A3D620962E25; Tue, 12 May 2020 16:06:50 +0200 (CEST) Date: Tue, 12 May 2020 16:06:50 +0200 From: Peter Zijlstra To: Phil Auld Cc: Vincent Guittot , linux-kernel , Ingo Molnar , Juri Lelli Subject: Re: [PATCH v2] sched/fair: Fix enqueue_task_fair warning some more Message-ID: <20200512140650.GJ2978@hirez.programming.kicks-ass.net> References: <20200506141821.GA9773@lorien.usersys.redhat.com> <20200507203612.GF19331@lorien.usersys.redhat.com> <20200511204410.GI13245@lorien.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511204410.GI13245@lorien.usersys.redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 04:44:10PM -0400, Phil Auld wrote: > Peter/Ingo, do you want me to resend or can you fix when applying? I now have this, do I need more edits? --- Subject: sched/fair: Fix enqueue_task_fair warning some more From: Phil Auld Date: Thu, 7 May 2020 16:36:12 -0400 From: Phil Auld 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 no longer points to the sched_entity which broke out of the first loop. 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: Vincent Guittot Reviewed-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20200507203612.GF19331@lorien.usersys.redhat.com --- kernel/sched/fair.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5479,6 +5479,13 @@ enqueue_task_fair(struct rq *rq, struct /* 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: