Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1051041ybj; Thu, 7 May 2020 13:40:16 -0700 (PDT) X-Google-Smtp-Source: APiQypKdHumz2kPWQDVsaC+K9BqiJ4eqej97kklKt0gbsk/3Ru3sZyKweeW+7BrmyvbB7GwIfmCg X-Received: by 2002:a05:6402:17e3:: with SMTP id t3mr13744225edy.203.1588884015957; Thu, 07 May 2020 13:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588884015; cv=none; d=google.com; s=arc-20160816; b=t7ZS1ISWz/u+nQQDLGJzYvRtzQh7ER9ow0J7f/nlTJ6eeyE7yNidDGqUZRZhbb1Ng8 u9/vT3Xwfh1Y5GQyTgwQ3U69XiuSRCtE38Dufyn6XyekYzmjCgs4xN1G4f6Kvf6TbaWH HamIVHdFVlt58Py08ivSVFYA38Q0HBB2pEXszqtSO6ugun/RMvnPhwqFXGiGRFMLJIZC S15tF9opUc0EmLYdg73SaTsv2D+jnZAKHFwtWgiAXjmU05FlEez6ccW9X3Q1j3W0I2up 8TUwwOrQorSwnptnm7yt78l2t8wlADk9pDC8slOQNUfBoFO3YKAR35fh4vnPxk/JtXzM D/hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rv5eIJrZc8+pWBy8rh5T+3XSWyi3D/3uE0M0Vzn71aU=; b=uoreigy+1KwOApFwfQcJ8O761+FKxXm8ZUy5XzYwXHg+48ln39nbl+EZJgNwW386Es wOKJaurevM9kf3rllfcyJnX5PsAqJopFZvwVQacGIXccyNakBO4KZCisWGd/QFOBSkqu 136FF30kSfoTGVM+Jl1/XqfsjZMq+qh5QvBDR0HC33qLMKlxoC30buGke5RvQhW9Q7ux FBvriiNwCKEV4Eh7pytcRQj1WYvAnlt7F/A+F9025Qk1erUVbcDo6w53F23ml22vVuPU JDPmu6pF0Zvoq7YgBRssOlLMIBv4+0clMgsIJWiELGAAMGHngsYDIW7+fzomfieli/aL Zznw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UxXfzZ7E; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si3808150edq.326.2020.05.07.13.39.52; Thu, 07 May 2020 13:40:15 -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=@redhat.com header.s=mimecast20190719 header.b=UxXfzZ7E; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgEGUgW (ORCPT + 99 others); Thu, 7 May 2020 16:36:22 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20655 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726093AbgEGUgV (ORCPT ); Thu, 7 May 2020 16:36:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588883781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rv5eIJrZc8+pWBy8rh5T+3XSWyi3D/3uE0M0Vzn71aU=; b=UxXfzZ7E00oQmwdRYp39lQzYovvQ2nsQ+j/4dcUS2fq9KVyUTn+NvOCQA34kLJHAZCL2dR 6L+HZqXuOrsE6T3ZNemu2xxCjtumzUx4QYpXaMGljPOAh5WKmjSMOxGfWI4lP5Atm94EsV vFqI5dpWmz9+IyW/gbYF4fAilFZGg3M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-9eW-r02WOXKNDufNhWxvvw-1; Thu, 07 May 2020 16:36:18 -0400 X-MC-Unique: 9eW-r02WOXKNDufNhWxvvw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21ACE1052508; Thu, 7 May 2020 20:36:17 +0000 (UTC) Received: from lorien.usersys.redhat.com (ovpn-114-114.phx2.redhat.com [10.3.114.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE3B619C4F; Thu, 7 May 2020 20:36:13 +0000 (UTC) Date: Thu, 7 May 2020 16:36:12 -0400 From: Phil Auld To: peterz@infradead.org Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, vincent.guittot@linaro.org, juri.lelli@redhat.com Subject: Re: [PATCH v2] sched/fair: Fix enqueue_task_fair warning some more Message-ID: <20200507203612.GF19331@lorien.usersys.redhat.com> References: <20200506141821.GA9773@lorien.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200506141821.GA9773@lorien.usersys.redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 leaf_add_rq_list if there are throttled parents while doing the second for_each_sched_entity loop. Suggested-by: Vincent Guittot Signed-off-by: Phil Auld Cc: Peter Zijlstra (Intel) Cc: Vincent Guittot Cc: Ingo Molnar Cc: Juri Lelli --- kernel/sched/fair.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 02f323b85b6d..c6d57c334d51 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: -- 2.18.0 V2 rework the fix based on Vincent's suggestion. Thanks Vincent. Cheers, Phil --