From patchwork Tue Mar 11 16:26:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26042 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C8FB9202E1 for ; Tue, 11 Mar 2014 16:27:09 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf22427720pbc.8 for ; Tue, 11 Mar 2014 09:27:06 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=n+2nnm7gVs0ZGOxxAsKc/Sfcq3ksPWiCuuY6pO5ifb4=; b=ddo59VxnIf9rdkWgbc/Ouw3UnDuNqcOqHXxYVehREyC4Jfx3RWWrGWzWjZ4NNh5owL gH09MrqZlCL2hyjDa2dxrigx6fWrBbR+iH4LbuOkRRMpNXTB0YJNlihFX5e6bgsDks8d GK3e7ndI1/sZsc2KPg+AeN/2/tynspduSdtYvLKvRHKsmML/a8hsvQE7D10m7wWXfHW0 vmBbz9sPYu7U4zfba0a3nX/Ef/Q5DjCcBKjrrg9UVpXycrjrjQwVLdRttYkRlxE45hK2 lpwK660IMmveoUlA0wxOQY/LWncDtSKNTtIa9Be2EiFuwubo+2lJvV6G33Y0/FQesH4i rG4A== X-Gm-Message-State: ALoCoQlPLtDQ/C8+aBQJv+89WZ7PEj1CjOm3hrXuk7cEPMHPhGvMoX39r4M6LINPxoxep5smjDmg X-Received: by 10.66.240.37 with SMTP id vx5mr15914285pac.8.1394555225552; Tue, 11 Mar 2014 09:27:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.1 with SMTP id v1ls2629615qge.50.gmail; Tue, 11 Mar 2014 09:27:05 -0700 (PDT) X-Received: by 10.220.247.68 with SMTP id mb4mr313663vcb.37.1394555225442; Tue, 11 Mar 2014 09:27:05 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id fi2si6588385vdb.10.2014.03.11.09.27.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 09:27:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id cz12so8686123veb.21 for ; Tue, 11 Mar 2014 09:27:05 -0700 (PDT) X-Received: by 10.52.139.237 with SMTP id rb13mr31500vdb.33.1394555225374; Tue, 11 Mar 2014 09:27:05 -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.78.9 with SMTP id i9csp217453vck; Tue, 11 Mar 2014 09:27:04 -0700 (PDT) X-Received: by 10.68.216.133 with SMTP id oq5mr49111080pbc.72.1394555224575; Tue, 11 Mar 2014 09:27:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vu10si20658037pbc.309.2014.03.11.09.27.03; Tue, 11 Mar 2014 09:27:03 -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 S1753030AbaCKQ05 (ORCPT + 26 others); Tue, 11 Mar 2014 12:26:57 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:59277 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945AbaCKQ04 (ORCPT ); Tue, 11 Mar 2014 12:26:56 -0400 Received: by mail-wi0-f176.google.com with SMTP id hr14so1155569wib.15 for ; Tue, 11 Mar 2014 09:26:55 -0700 (PDT) X-Received: by 10.194.57.140 with SMTP id i12mr37121047wjq.20.1394555214893; Tue, 11 Mar 2014 09:26:54 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id n15sm7921626wij.3.2014.03.11.09.26.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 09:26:54 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: Vincent Guittot Subject: [PATCH] sched: fix: remove double calculation in fix_small_imbalance Date: Tue, 11 Mar 2014 17:26:06 +0100 Message-Id: <1394555166-22894-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.0 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=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 tmp value has been already calculated in: scaled_busy_load_per_task = (busiest->load_per_task * SCHED_POWER_SCALE) / busiest->group_power; Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f1eedae..b301918 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6061,12 +6061,10 @@ void fix_small_imbalance(struct lb_env *env, struct sd_lb_stats *sds) pwr_now /= SCHED_POWER_SCALE; /* Amount of load we'd subtract */ - tmp = (busiest->load_per_task * SCHED_POWER_SCALE) / - busiest->group_power; - if (busiest->avg_load > tmp) { + if (busiest->avg_load > scaled_busy_load_per_task) { pwr_move += busiest->group_power * min(busiest->load_per_task, - busiest->avg_load - tmp); + busiest->avg_load - scaled_busy_load_per_task); } /* Amount of load we'd add */