From patchwork Wed Jun 24 07:11:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 50253 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2976B21575 for ; Wed, 24 Jun 2015 07:11:55 +0000 (UTC) Received: by lbbvz5 with SMTP id vz5sf8504286lbb.1 for ; Wed, 24 Jun 2015 00:11:53 -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=fIMm0JkWcnKQh0IUvYZ2Op+vpHhCR5HhplZJxuOMOoU=; b=YDv5iy4Kezy1cjXMUEa2j0zg9+M4OZgl7YHjByYACRJihjKZl89N7UiNzCl/kM7zWM mDj/SLerFVP3zq5QRXarHvoy53OKFq6vkq5V1Go7h/v/UK8WW7MnNUDsy6xotuTskisH oBhhbaqw+jloNr7azrGy0+MpwBwsWygcUjY4p25Xdl/UtqPPboX4sc9xVg0iT40dpS+E BPYEWKUfOb4lvWXfJKYapzqd3GVXIfgTUatnydTvQW+M2V5nqJ3DY/6wqIn8I7PtWBrQ YkRSDtxUxkyZ/gF0cwyGq+VObAT26yXNIKw/WvSCh/pWhQj0vD7bBVtQJAm9s0IdvrE3 l/Uw== X-Gm-Message-State: ALoCoQnrBqELDbiR0rzBQPcSzFKCznQV/r/dLBuF9CkFzOmJ+sZKc3anBImA161FWtgIQ5C0/Pob X-Received: by 10.180.198.172 with SMTP id jd12mr890923wic.5.1435129913953; Wed, 24 Jun 2015 00:11:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.196 with SMTP id a4ls137001lak.27.gmail; Wed, 24 Jun 2015 00:11:53 -0700 (PDT) X-Received: by 10.112.63.201 with SMTP id i9mr3373377lbs.93.1435129913753; Wed, 24 Jun 2015 00:11:53 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id lc17si17468211lbb.19.2015.06.24.00.11.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 00:11:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lacny3 with SMTP id ny3so20329729lac.3 for ; Wed, 24 Jun 2015 00:11:53 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr39453195lbb.56.1435129913189; Wed, 24 Jun 2015 00:11:53 -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.112.108.230 with SMTP id hn6csp3589335lbb; Wed, 24 Jun 2015 00:11:52 -0700 (PDT) X-Received: by 10.66.144.40 with SMTP id sj8mr76198541pab.55.1435129911436; Wed, 24 Jun 2015 00:11:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16si38461258pdl.216.2015.06.24.00.11.50; Wed, 24 Jun 2015 00:11:51 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbbFXHLs (ORCPT + 30 others); Wed, 24 Jun 2015 03:11:48 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:34913 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbbFXHLk (ORCPT ); Wed, 24 Jun 2015 03:11:40 -0400 Received: by wgbhy7 with SMTP id hy7so27978510wgb.2 for ; Wed, 24 Jun 2015 00:11:39 -0700 (PDT) X-Received: by 10.195.13.113 with SMTP id ex17mr66666448wjd.17.1435129899612; Wed, 24 Jun 2015 00:11:39 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-1-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id qq1sm39061270wjc.0.2015.06.24.00.11.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 00:11:38 -0700 (PDT) From: Vincent Guittot To: yuyang.du@intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org Cc: pjt@google.com, bsegall@google.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, len.brown@intel.com, rafael.j.wysocki@intel.com, fengguang.wu@intel.com, boqun.feng@gmail.com, srikar@linux.vnet.ibm.com, Vincent Guittot Subject: [PATCH] sched: update blocked load of idle cpus Date: Wed, 24 Jun 2015 09:11:12 +0200 Message-Id: <1435129872-22915-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435018085-7004-3-git-send-email-yuyang.du@intel.com> References: <1435018085-7004-3-git-send-email-yuyang.du@intel.com> 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.215.42 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: , The load and the util of idle cpus must be updated periodically in order to decay the blocked part. If CONFIG_FAIR_GROUP_SCHED is not set, the load and util of idle cpus are not decayed and stay at the values set before becoming idle. Signed-off-by: Vincent Guittot --- Hi Yuyang, While testing your patchset without CONFIG_FAIR_GROUP_SCHED, i have noticed that the load of idle cpus stays sometimes to an high value whereas they were not used for a while because we are not decaying the blocked load. Futhermore, the peridodic load balance was not pulling tasks onto some idle cpus because their load stayed high. This patchset fixes the issue. Regards, Vincent kernel/sched/fair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c5f18d9..665cc4b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5864,6 +5864,17 @@ static unsigned long task_h_load(struct task_struct *p) #else static inline void update_blocked_averages(int cpu) { + struct rq *rq = cpu_rq(cpu); + struct cfs_rq *cfs_rq = &rq->cfs; + unsigned long flags; + + raw_spin_lock_irqsave(&rq->lock, flags); + update_rq_clock(rq); + + update_cfs_rq_load_avg(cfs_rq_clock_task(cfs_rq), cfs_rq)) + + raw_spin_unlock_irqrestore(&rq->lock, flags); + } static unsigned long task_h_load(struct task_struct *p)