From patchwork Fri May 23 18:16:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 30842 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D30D620369 for ; Fri, 23 May 2014 18:17:16 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf17778264vcb.3 for ; Fri, 23 May 2014 11:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=W1oBH8yK8gc/mkj65OpNtF91OEopQk2cwW0+TaQyRgg=; b=OQRrcy28bBu2evh1Pyy19tW2ai6NcdOefocWSfYuu2G0T/2uvoqaJmRwhviURj0ntX D34hT+LW+MzddkXE0Shx1f7tvUL8hTvs5fYGgLsc4YeHGWQBmnM/fdnvTUkuSD34kUNm YueypnZwazvUgKqT8uXsHx/I8KGo+yWBhCCl1Ql8Smc3E6uSnsIFBIi49fXg8k219XuJ pRcv5qpaTRoAhhbM+Zn7jEpVgqXd2ljXCbWN2Zt4SBl2IDqaWOZcUGovCLD45aJM5muX 8w05HVz8xL2qzTY/JRjwnCPLtU1SeZB5qCm81BvShmoLh2ZHQhN+ugYDMz8TakBATouK khKw== X-Gm-Message-State: ALoCoQnYnqf6k8pEh5PRm7kdpx6xj4U+35KstAJy5Vil3b3f6IPrM6SXj4MYOPlkkzgx9EoPzqhl X-Received: by 10.58.225.197 with SMTP id rm5mr2286301vec.5.1400869036692; Fri, 23 May 2014 11:17:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.36 with SMTP id f33ls1833761qga.19.gmail; Fri, 23 May 2014 11:17:16 -0700 (PDT) X-Received: by 10.52.250.4 with SMTP id yy4mr1625445vdc.56.1400869036526; Fri, 23 May 2014 11:17:16 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id n9si2106295vcx.91.2014.05.23.11.17.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 11:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so6757901veb.33 for ; Fri, 23 May 2014 11:17:16 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr5732904vcg.16.1400869036443; Fri, 23 May 2014 11:17:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp52288vcb; Fri, 23 May 2014 11:17:16 -0700 (PDT) X-Received: by 10.66.191.9 with SMTP id gu9mr8123292pac.27.1400869035616; Fri, 23 May 2014 11:17:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nv7si4960566pbb.56.2014.05.23.11.17.13 for ; Fri, 23 May 2014 11:17:13 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751830AbaEWSRB (ORCPT + 27 others); Fri, 23 May 2014 14:17:01 -0400 Received: from service87.mimecast.com ([91.220.42.44]:36486 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbaEWSQ6 (ORCPT ); Fri, 23 May 2014 14:16:58 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 23 May 2014 19:16:57 +0100 Received: from e103034-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 May 2014 19:16:56 +0100 From: Morten Rasmussen To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, peterz@infradead.org, mingo@kernel.org Cc: rjw@rjwysocki.net, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, preeti@linux.vnet.ibm.com, dietmar.eggemann@arm.com Subject: [RFC PATCH 16/16] sched: Disable wake_affine to broaden the scope of wakeup target cpus Date: Fri, 23 May 2014 19:16:43 +0100 Message-Id: <1400869003-27769-17-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400869003-27769-1-git-send-email-morten.rasmussen@arm.com> References: <1400869003-27769-1-git-send-email-morten.rasmussen@arm.com> X-OriginalArrivalTime: 23 May 2014 18:16:57.0026 (UTC) FILETIME=[2E9C6A20:01CF76B3] X-MC-Unique: 114052319165700501 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: morten.rasmussen@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , SD_WAKE_AFFINE is currently set by default on all levels which means that wakeups are always handled inside the lowest level sched_domain. That means a tiny periodic task is very likely to stay on the cpu it was forked on forever. To save energy we need to revisit the task placement decision every now and again to ensure that we don't keep waking the same cpu if there are cheaper alternatives. One way is to simply disable wake_affine and rely on the fork/exec balancing mechanism (find_idlest_{group, cpu}). This is what this patch does. An alternative is to let the platform remove the SD_WAKE_AFFINE flag from lower levels to increase the search space for select_idle_sibling(). Signed-off-by: Morten Rasmussen --- kernel/sched/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 49b895a..eeb0508 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6069,8 +6069,13 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) | 1*SD_BALANCE_NEWIDLE | 1*SD_BALANCE_EXEC | 1*SD_BALANCE_FORK +#ifdef CONFIG_SCHED_ENERGY + | 1*SD_BALANCE_WAKE + | 0*SD_WAKE_AFFINE +#else | 0*SD_BALANCE_WAKE | 1*SD_WAKE_AFFINE +#endif | 0*SD_SHARE_CPUPOWER | 0*SD_SHARE_PKG_RESOURCES | 0*SD_SERIALIZE