From patchwork Fri Aug 5 06:31:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 73340 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1768425qga; Thu, 4 Aug 2016 23:31:57 -0700 (PDT) X-Received: by 10.98.60.20 with SMTP id j20mr132902868pfa.114.1470378717042; Thu, 04 Aug 2016 23:31:57 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m89si18809364pfk.254.2016.08.04.23.31.56; Thu, 04 Aug 2016 23:31:57 -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; dkim=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030358AbcHEGbn (ORCPT + 27 others); Fri, 5 Aug 2016 02:31:43 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35646 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbcHEGbm (ORCPT ); Fri, 5 Aug 2016 02:31:42 -0400 Received: by mail-pa0-f44.google.com with SMTP id iw10so89970417pac.2 for ; Thu, 04 Aug 2016 23:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=1U2NydfeeJLVYiTEj7iGTxUtCzbL0ItzCQbCQwLogaw=; b=bJXX8pm1s9gwMFldTzINZJzqTXI7G7LMGw0UTLfLhElYSJU/acpR0M2tliY9JDjBwW Kbjar8wjwcWDccyHU0BV8vIT1PAWsJZPy/e4TTZYY2UbaLUWECjOGIyamaFnNZE4XS/Y nQk+hccqxSEdbPdGcThWaSLacETe03fPjB3a8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1U2NydfeeJLVYiTEj7iGTxUtCzbL0ItzCQbCQwLogaw=; b=HJCN+/Yk2H/i7W8SkknC/KDtskTt3X7BpPoPT+hi0PtZ+AodSGJS8V3/DczgOQdjXz zpVEanExLVvkiwHyHiFHevBWhYfZVWhxxWv7ooq7B4hhDM3hjdowtusCuz5VQs7zk4a9 qlNMkvd9YOkU+VQaymYt3Y1c2ATcOScnQRwTcunkBT+MAMMSK1oHYpIroujNhuDAtIy+ QbVOKE3VrCnt8CbtgoqRApvigVVlfgJ4FtUBrkSkMkupq3xlA6uxsLYlxZsafbWCMqOz sOzNeDCNwdVGgFS2R7JKcoiCx7yqd6Orv6yUhmkAhsbrrQF7FYqKoSn8hKv/DVbmpSCz F4/w== X-Gm-Message-State: AEkoouuapiHoN4+Jk6A9uQsrLBAVNrmHYMF94atb1S8Mfc2duNzonzmCMR4nqdtxKpbijqJf X-Received: by 10.67.1.35 with SMTP id bd3mr133831746pad.16.1470378701557; Thu, 04 Aug 2016 23:31:41 -0700 (PDT) Received: from localhost.localdomain (61-216-91-114.HINET-IP.hinet.net. [61.216.91.114]) by smtp.gmail.com with ESMTPSA id u1sm24791555pfu.12.2016.08.04.23.31.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Aug 2016 23:31:40 -0700 (PDT) From: Leo Yan To: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH] sched/fair: polish function update_next_balance() Date: Fri, 5 Aug 2016 14:31:29 +0800 Message-Id: <1470378689-14892-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function update_next_balance() is only used by idle balance, so its parameter 'cpu_busy' is redundant and always be passed with 0. This patch is to polish update_next_balance() to remove parameter 'cpu_busy'. Signed-off-by: Leo Yan --- kernel/sched/fair.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4088eed..e342159 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7704,11 +7704,12 @@ get_sd_balance_interval(struct sched_domain *sd, int cpu_busy) } static inline void -update_next_balance(struct sched_domain *sd, int cpu_busy, unsigned long *next_balance) +update_next_balance(struct sched_domain *sd, unsigned long *next_balance) { unsigned long interval, next; - interval = get_sd_balance_interval(sd, cpu_busy); + /* used by idle balance, so cpu_busy = 0 */ + interval = get_sd_balance_interval(sd, 0); next = sd->last_balance + interval; if (time_after(*next_balance, next)) @@ -7738,7 +7739,7 @@ static int idle_balance(struct rq *this_rq) rcu_read_lock(); sd = rcu_dereference_check_sched_domain(this_rq->sd); if (sd) - update_next_balance(sd, 0, &next_balance); + update_next_balance(sd, &next_balance); rcu_read_unlock(); goto out; @@ -7756,7 +7757,7 @@ static int idle_balance(struct rq *this_rq) continue; if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) { - update_next_balance(sd, 0, &next_balance); + update_next_balance(sd, &next_balance); break; } @@ -7774,7 +7775,7 @@ static int idle_balance(struct rq *this_rq) curr_cost += domain_cost; } - update_next_balance(sd, 0, &next_balance); + update_next_balance(sd, &next_balance); /* * Stop searching for tasks to pull if there are