Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp634013imm; Wed, 4 Jul 2018 03:22:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdn6S+FrgZXOnGNJfLamlyBVGgmuARCM3g8RAwu4UqU82ibyKT3pMomwprG+bTyCvRE4TkP X-Received: by 2002:a63:375b:: with SMTP id g27-v6mr1379571pgn.59.1530699738554; Wed, 04 Jul 2018 03:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530699738; cv=none; d=google.com; s=arc-20160816; b=iYShrnZxyQxk3bC3h5L4EsDEY9dZ/K1RFGZivw0LXcrXFDFUiKzhY1MCFw7oQXzktt o5IM+5wyIkWModIHC/N0zKdg6rK2Rr3MAuSUPCMz9By80QgtpYGQkPbhYzCOwm4tXS8v /vLnGdwtZqGm/Cskb0zf2oZqBwoKu/0h1IpJqlAcyniM2MYhgAsRCcqw4eZe1UsgkbFX z4PJZqrmye7V+PZjvzWlGuv2Xv7RBJA2jt0MZQSz5IoUEIfR6h22feEvYxLDR0w1tv5+ NvEePMHYj96zP9WpBjQNioIJdQWoBuQvNgEeE7RIS9IolDQEqynXW1Hsw85xV+xbq9iK tq0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=QR5hzLhJUaRM7Sc9QL+BVSwiC4AJIQlz9ltVo5kTpFI=; b=VIyCunmht9r6ug1a27nYTFCOuxj3e7GSGJwg/YwWF2sbCdLXvt7hx+CQokQXYCBRt9 14AvNTRpvg+cKHU5lQqfF8mSEl6ahDYHq4QSqhjbV+vTKl8pe79NVMPEyIR7THrDXhvj QXtadT8KWZz0fiUjgFbMuMhozMopQljs0UtJjsxAa3q1UqtQuerRrG1JQVEYKra804du tDO2imPXcyn4nkBIcglPqKjCYQL8u1JdidtpxiAPnMklnnLiD3Zt8pCUlGGfptW+Sv2k rp6otuyzghs20ZCfsQdMk3ruAinnQoxyQa2s2SR2RNjARaMJfEEt5paucOvrPh+2bkqB qvbg== 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 l8-v6si2860897pgq.432.2018.07.04.03.22.04; Wed, 04 Jul 2018 03:22:18 -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 S934646AbeGDKUn (ORCPT + 99 others); Wed, 4 Jul 2018 06:20:43 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934454AbeGDKST (ORCPT ); Wed, 4 Jul 2018 06:18:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 918A81688; Wed, 4 Jul 2018 03:18:19 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (e105550-lin.cambridge.arm.com [10.1.211.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A7F23F5AD; Wed, 4 Jul 2018 03:18:17 -0700 (PDT) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, gaku.inami.xh@renesas.com, linux-kernel@vger.kernel.org, Morten Rasmussen Subject: [PATCHv4 05/12] sched/fair: Kick nohz balance if rq->misfit_task_load Date: Wed, 4 Jul 2018 11:17:43 +0100 Message-Id: <1530699470-29808-6-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530699470-29808-1-git-send-email-morten.rasmussen@arm.com> References: <1530699470-29808-1-git-send-email-morten.rasmussen@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Valentin Schneider There already are a few conditions in nohz_kick_needed() to ensure a nohz kick is triggered, but they are not enough for some misfit task scenarios. Excluding asym packing, those are: * rq->nr_running >=2: Not relevant here because we are running a misfit task, it needs to be migrated regardless and potentially through active balance. * sds->nr_busy_cpus > 1: If there is only the misfit task being run on a group of low capacity cpus, this will be evaluated to False. * rq->cfs.h_nr_running >=1 && check_cpu_capacity(): Not relevant here, misfit task needs to be migrated regardless of rt/IRQ pressure As such, this commit adds an rq->misfit_task_load condition to trigger a nohz kick. The idea to kick a nohz balance for misfit tasks originally came from Leo Yan , and a similar patch was submitted for the Android Common Kernel - see [1]. [1]: https://lists.linaro.org/pipermail/eas-dev/2016-September/000551.html cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Valentin Schneider Signed-off-by: Morten Rasmussen --- 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 6e885d92fad2..acec93e1dc51 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9505,7 +9505,7 @@ static void nohz_balancer_kick(struct rq *rq) if (time_before(now, nohz.next_balance)) goto out; - if (rq->nr_running >= 2) { + if (rq->nr_running >= 2 || rq->misfit_task_load) { flags = NOHZ_KICK_MASK; goto out; } -- 2.7.4