Received: by 10.192.165.148 with SMTP id m20csp1614801imm; Thu, 3 May 2018 02:27:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoMitNCKXDAV0siFBHzRX5zbLBjXNDoAZuhUb/QVbAxkaO8oHvB3AVuNb6d/o15o/J6m7Hi X-Received: by 2002:a17:902:7795:: with SMTP id o21-v6mr3276869pll.36.1525339625418; Thu, 03 May 2018 02:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525339625; cv=none; d=google.com; s=arc-20160816; b=Yl9djMh1sN0cGLckdDWEJvBpg4q3mT5vXZyTVKvXeWKIiD8iDWsI8iOvEV8SdyzaAu ilLCSrDE6DVKCxxbkhrXgStXk5GrbAZ3jrD648WQJA6JhcEXkfJjsYBIxJI56CT8nkZy 4TfY48as7EOBCIJ2uPGDn1zRVKaxhE6hLr1Q172YJ+1cu5XL0OzXgVPcrtx8b2kR71JL 418w7eVEJupsjhnvEEjeVkXnma3IyBFzE3Bmj7iYKRMGzzsOPFphY/ItCT5/0vMvl+ec 7mQtr358Umxdlh9Mt3b8X8EVX5iPuXSKRsfJGG4pCYYcdjW06MpECwgj8rIRYdT6nYnV ryUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=XKL5FW7mKCLM19Y9/P8qKE8n9QIiThXLd2QV23X9W/E=; b=i5fT0GPyTl8wl9fiy2MVekCg+6mi25C78ewGH1vVpKLWexCcnzmz28wSos0BNuEaRV MEpMgT9A8I0gQCoQ1A8cnJznRq9eBYc/wY3i1yZyw1Q+Guzu//klJ3BIHyUEz7+M4+fv EcKfu7tm2mWgb6FxtsValXbzGEiwlhcqspU0Xdv8uBxXSXjvTnW4C86uLcnwcmUl0tY1 tPQH9+UQdx/zoFU7QZkx4ApdIzy0hVTPL9mVBBhlj/JqQWzkLlAyAHXMmhtcqB5mRn3M ZuZhsIexn1LHS3t5ZynMJEUoqqisl5sqVt68N+r4MzBqIzi/BO38cy2EESAqmcSHci1K KxJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29-v6si11208006pgn.9.2018.05.03.02.26.51; Thu, 03 May 2018 02:27:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbeECJ01 (ORCPT + 99 others); Thu, 3 May 2018 05:26:27 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51219 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbeECJ0X (ORCPT ); Thu, 3 May 2018 05:26:23 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w439PSiF512682; Thu, 3 May 2018 02:25:28 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w439PS7S512679; Thu, 3 May 2018 02:25:28 -0700 Date: Thu, 3 May 2018 02:25:28 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vincent Guittot Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, hkallweit1@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, geert+renesas@glider.be, vincent.guittot@linaro.org, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: hkallweit1@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org, torvalds@linux-foundation.org, geert+renesas@glider.be, vincent.guittot@linaro.org In-Reply-To: <20180426103133.GA6953@linaro.org> References: <20180426103133.GA6953@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/fair: Fix the update of blocked load when newly idle Git-Commit-ID: 457be908c83637ee10bda085a23dc05afa3b14a0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.6 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 457be908c83637ee10bda085a23dc05afa3b14a0 Gitweb: https://git.kernel.org/tip/457be908c83637ee10bda085a23dc05afa3b14a0 Author: Vincent Guittot AuthorDate: Thu, 26 Apr 2018 12:19:32 +0200 Committer: Ingo Molnar CommitDate: Thu, 3 May 2018 07:38:03 +0200 sched/fair: Fix the update of blocked load when newly idle With commit: 31e77c93e432 ("sched/fair: Update blocked load when newly idle") ... we release the rq->lock when updating blocked load of idle CPUs. This opens a time window during which another CPU can add a task to this CPU's cfs_rq. The check for newly added task of idle_balance() is not in the common path. Move the out label to include this check. Reported-by: Heiner Kallweit Tested-by: Geert Uytterhoeven Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 31e77c93e432 ("sched/fair: Update blocked load when newly idle") Link: http://lkml.kernel.org/r/20180426103133.GA6953@linaro.org Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 54dc31e7ab9b..e3002e5ada31 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9847,6 +9847,7 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf) if (curr_cost > this_rq->max_idle_balance_cost) this_rq->max_idle_balance_cost = curr_cost; +out: /* * While browsing the domains, we released the rq lock, a task could * have been enqueued in the meantime. Since we're not going idle, @@ -9855,7 +9856,6 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf) if (this_rq->cfs.h_nr_running && !pulled_task) pulled_task = 1; -out: /* Move the next balance forward */ if (time_after(this_rq->next_balance, next_balance)) this_rq->next_balance = next_balance;