From patchwork Fri May 23 15:53:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 30825 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 698CA20369 for ; Fri, 23 May 2014 15:55:02 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf22968020obc.5 for ; Fri, 23 May 2014 08:55:02 -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; bh=a5pe3HongVpg1xd+Wq/EPikFbYbUBIVUZunjdZK+UCU=; b=KNxc39J8gezAZhTBSwlqK7VNZYSVxvGgDT03ogvqsEi0faLiGZ8Q0i2zDrA+VPFPSO qQ500Hymht+3yGylSazsLsPccVVkKhJAZJb7nm8TR3YrVjmQ8RBXIpVSIO8WbRlHLB2I yiOBjU53jrWM8b5m0ol46FdtIFMKlAnlkR8GB8cg3dy7Kp6GQv4T1hfCirCRkFY5lWuY mDqcHCYMzOSBBZsJ9wnNp/+5OGOOz4cBXc0axcEEm6vefZ78iejwwfLTAyog5fPL47re m52Ul7fqP8SadiMwbMoYjN7XrlRSY3ki5nQ0wHNl9iJEQdEocgKzPeg9LiJ2j8fZypv0 wSIw== X-Gm-Message-State: ALoCoQkDE740a2XWrhI91q050jXy6XMKuJqs5SzYsUDQzfNNQnM1EF0BxSON7e3+wR7OzjduRZNv X-Received: by 10.182.125.4 with SMTP id mm4mr978412obb.49.1400860502043; Fri, 23 May 2014 08:55:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.173 with SMTP id 42ls1833273qgh.27.gmail; Fri, 23 May 2014 08:55:01 -0700 (PDT) X-Received: by 10.52.252.4 with SMTP id zo4mr1081001vdc.74.1400860501809; Fri, 23 May 2014 08:55:01 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id uk3si1866108vec.102.2014.05.23.08.55.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:55:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so6496960veb.38 for ; Fri, 23 May 2014 08:55:01 -0700 (PDT) X-Received: by 10.53.13.133 with SMTP id ey5mr4259275vdd.8.1400860501738; Fri, 23 May 2014 08:55:01 -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 ib8csp42740vcb; Fri, 23 May 2014 08:55:01 -0700 (PDT) X-Received: by 10.68.161.101 with SMTP id xr5mr7048412pbb.168.1400860500976; Fri, 23 May 2014 08:55:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ah1si4439705pbc.97.2014.05.23.08.55.00 for ; Fri, 23 May 2014 08:55:00 -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 S1753369AbaEWPyd (ORCPT + 27 others); Fri, 23 May 2014 11:54:33 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:58711 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753213AbaEWPyY (ORCPT ); Fri, 23 May 2014 11:54:24 -0400 Received: by mail-we0-f176.google.com with SMTP id q59so5113764wes.35 for ; Fri, 23 May 2014 08:54:23 -0700 (PDT) X-Received: by 10.180.36.212 with SMTP id s20mr4206465wij.18.1400860463647; Fri, 23 May 2014 08:54:23 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id m1sm3558594wib.20.2014.05.23.08.54.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:54:22 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Cc: preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, Vincent Guittot Subject: [PATCH v2 10/11] sched: move cfs task on a CPU with higher capacity Date: Fri, 23 May 2014 17:53:04 +0200 Message-Id: <1400860385-14555-11-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400860385-14555-1-git-send-email-vincent.guittot@linaro.org> References: <1400860385-14555-1-git-send-email-vincent.guittot@linaro.org> 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: vincent.guittot@linaro.org 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.179 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: , If the CPU is used for handling lot of IRQs, trig a load balance to check if it's worth moving its tasks on another CPU that has more capacity Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e8a30f9..2501e49 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5948,6 +5948,13 @@ static bool update_sd_pick_busiest(struct lb_env *env, if (sgs->sum_nr_running > sgs->group_capacity) return true; + /* + * The group capacity is reduced probably because of activity from other + * sched class or interrupts which use part of the available capacity + */ + if ((sg->sgp->power_orig * 100) > (sgs->group_power * env->sd->imbalance_pct)) + return true; + if (sgs->group_imb) return true; @@ -7282,6 +7289,12 @@ static inline int nohz_kick_needed(struct rq *rq) if (nr_busy > 1) goto need_kick_unlock; + + if ((rq->cfs.h_nr_running >= 1) + && ((rq->cpu_power * sd->imbalance_pct) < + (rq->cpu_power_orig * 100))) + goto need_kick_unlock; + } sd = rcu_dereference(per_cpu(sd_asym, cpu));