From patchwork Mon May 23 10:58:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 68356 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp13351qge; Mon, 23 May 2016 03:58:48 -0700 (PDT) X-Received: by 10.98.87.133 with SMTP id i5mr26308421pfj.55.1464001126952; Mon, 23 May 2016 03:58:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si51081055pfb.137.2016.05.23.03.58.46; Mon, 23 May 2016 03:58:46 -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 S1754350AbcEWK6c (ORCPT + 30 others); Mon, 23 May 2016 06:58:32 -0400 Received: from foss.arm.com ([217.140.101.70]:50119 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754317AbcEWK6a (ORCPT ); Mon, 23 May 2016 06:58:30 -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 6185A444; Mon, 23 May 2016 03:58:51 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (e105550-lin.cambridge.arm.com [10.1.207.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1727C3F246; Mon, 23 May 2016 03:58:27 -0700 (PDT) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: dietmar.eggemann@arm.com, yuyang.du@intel.com, vincent.guittot@linaro.org, mgalbraith@suse.de, linux-kernel@vger.kernel.org, Morten Rasmussen Subject: [PATCH 03/16] sched/fair: Disregard idle task wakee_flips in wake_wide Date: Mon, 23 May 2016 11:58:45 +0100 Message-Id: <1464001138-25063-4-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464001138-25063-1-git-send-email-morten.rasmussen@arm.com> References: <1464001138-25063-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 wake_wide() is based on task wakee_flips of the waker and the wakee to decide whether an affine wakeup is desirable. On lightly loaded systems the waker is frequently the idle task (pid=0) which can accumulate a lot of wakee_flips in that scenario. It makes little sense to prevent affine wakeups on an idle cpu due to the idle task wakee_flips, so it makes more sense to ignore them in wake_wide(). cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c49e25a..0fe3020 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5007,6 +5007,10 @@ static int wake_wide(struct task_struct *p) unsigned int slave = p->wakee_flips; int factor = this_cpu_read(sd_llc_size); + /* Don't let the idle task prevent affine wakeups */ + if (is_idle_task(current)) + return 0; + if (master < slave) swap(master, slave); if (slave < factor || master < slave * factor)