From patchwork Wed Apr 16 02:43: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: 28440 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 8B89C2036D for ; Wed, 16 Apr 2014 02:45:44 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf25649076obc.9 for ; Tue, 15 Apr 2014 19:45:43 -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=/FVZX+1hxmtacDLoARNvNvhf72Ux/fw+xhwxDFTzmIs=; b=Vt0Kwv/8EPjQNxVCOtPHeWtgf9oBIcKjYEQ8XcVChmm6XJp9qF92x2kAWQ+lJunMsD gFeb5Xo84m9qh4WdqQAn7jY97bicveSj+114m9drxPvd51Z8c+eFXkjiRs8V0VVxArd6 M8ym9Bk/jaS2/XF0uBtJPbB+AiW1VAYJkb9MzlpfFHxL/dSDDGKk5MUbBoJqnunX8FxL dfIvVrtzI17sykr0o4omAXleyvA2LgYqma5u3SbQa+jNU0euIP4eqsVnWg9rbjXPNmmA /nO/OED7sj1A8o6zZV61liHNQQBhCCMjjVc+q/esSkdPAkeXHdno4f6I1V6iud6BGlmL V+Jg== X-Gm-Message-State: ALoCoQlTR0G+HDvkBn58qJ2dC3JUT1/GR/e1EQJuik6CsZ4c+yBv6Ume5hPjj3ZHU2C2jTPGbjF0 X-Received: by 10.42.123.66 with SMTP id q2mr845828icr.16.1397616343833; Tue, 15 Apr 2014 19:45:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.69 with SMTP id e63ls447904qgd.29.gmail; Tue, 15 Apr 2014 19:45:43 -0700 (PDT) X-Received: by 10.236.150.205 with SMTP id z53mr8962550yhj.75.1397616343746; Tue, 15 Apr 2014 19:45:43 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id k73si21780438yhi.154.2014.04.15.19.45.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:45:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so10276739veb.11 for ; Tue, 15 Apr 2014 19:45:43 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr3899541vef.12.1397616343517; Tue, 15 Apr 2014 19:45:43 -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.221.72 with SMTP id ib8csp277742vcb; Tue, 15 Apr 2014 19:45:43 -0700 (PDT) X-Received: by 10.66.241.66 with SMTP id wg2mr5704075pac.132.1397616342763; Tue, 15 Apr 2014 19:45:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hi3si11840313pac.41.2014.04.15.19.45.42; Tue, 15 Apr 2014 19:45:42 -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 S1752211AbaDPCpS (ORCPT + 26 others); Tue, 15 Apr 2014 22:45:18 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:43716 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbaDPCoY (ORCPT ); Tue, 15 Apr 2014 22:44:24 -0400 Received: by mail-pd0-f174.google.com with SMTP id y13so10097083pdi.5 for ; Tue, 15 Apr 2014 19:44:24 -0700 (PDT) X-Received: by 10.68.178.162 with SMTP id cz2mr5590606pbc.51.1397616264337; Tue, 15 Apr 2014 19:44:24 -0700 (PDT) Received: from alex-shi.Home ([116.232.95.240]) by mx.google.com with ESMTPSA id sv10sm43373627pbc.74.2014.04.15.19.44.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 19:44:23 -0700 (PDT) From: Alex Shi To: mingo@redhat.com, peterz@infradead.org, morten.rasmussen@arm.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, efault@gmx.de Cc: wangyun@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, mgorman@suse.de Subject: [PATCH V5 3/8] sched: remove source_load and target_load Date: Wed, 16 Apr 2014 10:43:24 +0800 Message-Id: <1397616209-27275-4-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1397616209-27275-1-git-send-email-alex.shi@linaro.org> References: <1397616209-27275-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.128.180 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 12a35ea..cad2b6d 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); @@ -3951,45 +3949,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; @@ -4202,8 +4166,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) @@ -4259,7 +4223,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 @@ -4301,11 +4265,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; } @@ -5763,11 +5723,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;