From patchwork Fri Apr 29 19:32:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 66967 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp969222qge; Fri, 29 Apr 2016 12:33:37 -0700 (PDT) X-Received: by 10.66.119.177 with SMTP id kv17mr4781617pab.57.1461958417305; Fri, 29 Apr 2016 12:33:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si19563929paa.62.2016.04.29.12.33.37; Fri, 29 Apr 2016 12:33:37 -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 S1752662AbcD2TdV (ORCPT + 29 others); Fri, 29 Apr 2016 15:33:21 -0400 Received: from foss.arm.com ([217.140.101.70]:53134 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbcD2TdT (ORCPT ); Fri, 29 Apr 2016 15:33:19 -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 632BF3ED; Fri, 29 Apr 2016 12:33:21 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.207.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4A1283F25F; Fri, 29 Apr 2016 12:33:18 -0700 (PDT) From: Dietmar Eggemann To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Morten Rasmussen Subject: [PATCH 2/7] sched/fair: Fix comment in calculate_imbalance() Date: Fri, 29 Apr 2016 20:32:39 +0100 Message-Id: <1461958364-675-3-git-send-email-dietmar.eggemann@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461958364-675-1-git-send-email-dietmar.eggemann@arm.com> References: <1461958364-675-1-git-send-email-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment survived from commit 2dd73a4f09be ("[PATCH] sched: implement smpnice") in which the selection of busiest and busiest->avg_load (max_load) was based on if(avg_load > max_load && sum_nr_running > group->cpu_power / SCHED_LOAD_SCALE). Commit b18855500fc4 ("sched/balancing: Fix 'local->avg_load > sds->avg_load' case in calculate_imbalance()") added the second operand of the or operator. Update this comment accordingly and also use the current variable names. Signed-off-by: Dietmar Eggemann --- kernel/sched/fair.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c77e01b55ec2..bc19fee94f39 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6998,9 +6998,10 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s } /* - * In the presence of smp nice balancing, certain scenarios can have - * max load less than avg load(as we skip the groups at or below - * its cpu_capacity, while calculating max_load..) + * Avg load of busiest sg can be less and avg load of local sg can + * be greater than avg load across all sgs of sd because avg load + * factors in sg capacity and sgs with smaller group_type are + * skipped when updating the busiest sg. */ if (busiest->avg_load <= sds->avg_load || local->avg_load >= sds->avg_load) {