From patchwork Thu Mar 13 05:57:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 26169 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 99FB7236AC for ; Thu, 13 Mar 2014 06:02:40 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf2168190obc.5 for ; Wed, 12 Mar 2014 23:02:40 -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=RYVSA7ubEtjullBDEnMJnp6SgsOCZpI/D9bqk3pfqm0=; b=l0ZGxJXDBw9QYtejE2U6ivNr+JTXfUEOy295vlwPN9gR48Y3DFIECq+qCXI+QoVEZR pDo5ADnNGYSWys+c5XRFlfTgzn1e88nO+h7XpMexKKujrszsNWZKO5ZHdgHDo3n1hJJy oF9bbz8Mf4nzSA4kq2TlJbzlQ0faV3LeWg2qw1SyTuCPjDRoUm54iaRtl4VTLxQ3YLqZ u8Fpo6B9jrJpYl/5Y+8SmkdV5/eqDRumEsI1CnrLevFWwbXotLUPjPqhJu28Cn7wl3mc uy6pxIuk6qg5fbZvWno9QIaz2w/74+sCORCNmTFmjoV+xT6xaykZx5l0VjIA6x5O+da8 gSFw== X-Gm-Message-State: ALoCoQmgSFTt9mfMHPkQoGTC6pCq4iKc7YSfa/63sqfqbsHyq2wxNVXVqnxxDi3ktt7HIsw56Fbn X-Received: by 10.182.251.230 with SMTP id zn6mr89923obc.14.1394690560133; Wed, 12 Mar 2014 23:02:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.137 with SMTP id l9ls154622qgf.40.gmail; Wed, 12 Mar 2014 23:02:40 -0700 (PDT) X-Received: by 10.58.165.68 with SMTP id yw4mr1515veb.17.1394690559996; Wed, 12 Mar 2014 23:02:39 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id a15si449221vew.83.2014.03.12.23.02.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:02:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so573948vcb.35 for ; Wed, 12 Mar 2014 23:02:39 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr36984vcb.16.1394690559895; Wed, 12 Mar 2014 23:02:39 -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 i9csp343223vck; Wed, 12 Mar 2014 23:02:39 -0700 (PDT) X-Received: by 10.69.2.2 with SMTP id bk2mr1997369pbd.75.1394690558921; Wed, 12 Mar 2014 23:02:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gj8si1131105pbc.114.2014.03.12.23.02.37; Wed, 12 Mar 2014 23:02: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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753268AbaCMGCa (ORCPT + 26 others); Thu, 13 Mar 2014 02:02:30 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:54303 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbaCMGC3 (ORCPT ); Thu, 13 Mar 2014 02:02:29 -0400 Received: by mail-pb0-f41.google.com with SMTP id jt11so620957pbb.28 for ; Wed, 12 Mar 2014 23:02:29 -0700 (PDT) X-Received: by 10.67.5.131 with SMTP id cm3mr85789pad.92.1394690549369; Wed, 12 Mar 2014 23:02:29 -0700 (PDT) Received: from localhost.localdomain ([116.232.110.156]) by mx.google.com with ESMTPSA id ix2sm3136331pbc.45.2014.03.12.23.01.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 23:02:28 -0700 (PDT) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com Cc: vincent.guittot@linaro.org, daniel.lezcano@linaro.org, fweisbec@gmail.com, linux@arm.linux.org.uk, tony.luck@intel.com, fenghua.yu@intel.com, james.hogan@imgtec.com, alex.shi@linaro.org, jason.low2@hp.com, viresh.kumar@linaro.org, hanjun.guo@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, akpm@linux-foundation.org, arjan@linux.intel.com, pjt@google.com, fengguang.wu@intel.com, linaro-kernel@lists.linaro.org, wangyun@linux.vnet.ibm.com, mgorman@suse.de Subject: [PATCH 3/8] sched: remove source_load and target_load Date: Thu, 13 Mar 2014 13:57:24 +0800 Message-Id: <1394690249-14130-4-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1394690249-14130-1-git-send-email-alex.shi@linaro.org> References: <1394690249-14130-1-git-send-email-alex.shi@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: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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: , We have no load_idx any more, so source/target_load always return the same value as weighted_cpuload. So we can remove these 2 functions. Signed-off-by: Alex Shi --- kernel/sched/fair.c | 54 +++++------------------------------------------------ 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4aee391..6469907 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1015,8 +1015,6 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page, } static unsigned long weighted_cpuload(const int cpu); -static unsigned long source_load(int cpu); -static unsigned long target_load(int cpu); static unsigned long power_of(int cpu); static long effective_load(struct task_group *tg, int cpu, long wl, long wg); @@ -3950,45 +3948,11 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) } #ifdef CONFIG_SMP -/* Used instead of source_load when we know the type == 0 */ static unsigned long weighted_cpuload(const int cpu) { return cpu_rq(cpu)->cfs.runnable_load_avg; } -/* - * Return a low guess at the load of a migration-source cpu weighted - * according to the scheduling class and "nice" value. - * - * We want to under-estimate the load of migration sources, to - * balance conservatively. - */ -static unsigned long source_load(int cpu) -{ - struct rq *rq = cpu_rq(cpu); - unsigned long total = weighted_cpuload(cpu); - - if (!sched_feat(LB_BIAS)) - return total; - - return min(rq->cpu_load, total); -} - -/* - * Return a high guess at the load of a migration-target cpu weighted - * according to the scheduling class and "nice" value. - */ -static unsigned long target_load(int cpu) -{ - struct rq *rq = cpu_rq(cpu); - unsigned long total = weighted_cpuload(cpu); - - if (!sched_feat(LB_BIAS)) - return total; - - return max(rq->cpu_load, total); -} - static unsigned long power_of(int cpu) { return cpu_rq(cpu)->cpu_power; @@ -4201,8 +4165,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) this_cpu = smp_processor_id(); prev_cpu = task_cpu(p); - load = source_load(prev_cpu); - this_load = target_load(this_cpu); + load = weighted_cpuload(prev_cpu); + this_load = weighted_cpuload(this_cpu); /* * If sync wakeup then subtract the (maximum possible) @@ -4258,7 +4222,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) if (balanced || (this_load <= load && - this_load + target_load(prev_cpu) <= tl_per_task)) { + this_load + weighted_cpuload(prev_cpu) <= tl_per_task)) { /* * This domain has SD_WAKE_AFFINE and * p is cache cold in this domain, and @@ -4300,11 +4264,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) avg_load = 0; for_each_cpu(i, sched_group_cpus(group)) { - /* Bias balancing toward cpus of our domain */ - if (local_group) - load = source_load(i); - else - load = target_load(i); + load = weighted_cpuload(i); avg_load += load; } @@ -5762,11 +5722,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { struct rq *rq = cpu_rq(i); - /* Bias balancing toward cpus of our domain */ - if (local_group) - load = target_load(i); - else - load = source_load(i); + load = weighted_cpuload(i); sgs->group_load += load; sgs->sum_nr_running += rq->nr_running;