From patchwork Fri Jun 8 12:09:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 137955 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp791655lji; Fri, 8 Jun 2018 05:11:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvDpYjboGHSLNKbOyUufIY+Wx2TOOKU//SrNuH3BbDYtmFLLNUZW1g7mDh5rj+PiObaLn5 X-Received: by 2002:a17:902:57d8:: with SMTP id g24-v6mr6506800plj.116.1528459864555; Fri, 08 Jun 2018 05:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528459864; cv=none; d=google.com; s=arc-20160816; b=efiXy4Sv34TcN0HgMFYUH1RK5ALlZqwLRSxXkX7ZaDJPhQvFksNqsX5wlMJkQ8oqG0 zf09Js6PgJgde3pIt6k9FXOxBDOvomdmKewU3xEwbuFrZzVtU8HYF0jO4z7B/bh0QwV4 9cem8rRlQOradWjzFYh/p1LonM9mPKR0YdCb28sVKVqsfx4L2ViOWWpHW2W5qkDVkW3C ichmblJ7CS/AeuaeYkpjMCV1XCxCTCwcUm15Ax2JTu/UcUrtBTcuB4JUQuwZZ0KFkMVH BczWe7Ok2JINkpF3Lp4Q91xphvWTOZInCpobw57t61Mz6F7D/Dr2PT3QL9+5pvMmEC8/ rzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=58hdi6z7ZlZyTvSIm6ukRmd6PdHbk/qiy6BqniuQYhU=; b=jmujK+rxwO870LQyMO3cZiZMME5P8fUliGiL0T5MrGD3zAQIxzsSWXaNjwMguMuEgx Oo/1pvB4Tiuytx0wQyrY8DqRVEqZLaazcYCWeCaJ++ucQztNL6qY5iLkD3pDIUyNl1oF 9WItJZ4qqKb/HwaQnTHeXqgdZce/c89ceuqzSTy00vf9KaF+9rk8z9rHu2PszTZAQ3lU 0Xj3AMXg0hohE7MgKf5/W8p3ualIoU28ykjBFXHVRrSQRXwcnPnGO6sNP0OpCEro5hOR 9DSW/DVrnffeD0Mj9VRySmMlvgH9ltUp1iZRzcOTgd94QMkUFe25avmLKOrewQhBTnx+ 1n+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GxldxOz+; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63-v6si54729164plb.366.2018.06.08.05.11.04; Fri, 08 Jun 2018 05:11:04 -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 header.s=google header.b=GxldxOz+; 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbeFHMKs (ORCPT + 30 others); Fri, 8 Jun 2018 08:10:48 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44369 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbeFHMKm (ORCPT ); Fri, 8 Jun 2018 08:10:42 -0400 Received: by mail-wr0-f193.google.com with SMTP id x4-v6so5016902wro.11 for ; Fri, 08 Jun 2018 05:10:41 -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:in-reply-to:references; bh=58hdi6z7ZlZyTvSIm6ukRmd6PdHbk/qiy6BqniuQYhU=; b=GxldxOz+1lbh48KaJ2SSUoO/92Mu8xpihJzxMwSv1MCwYocOsUphm/mCAEo4yIaNzQ hSCd3DjHx4K/c+BTdNiJmwQsnkWDeTfP10nIcpRWCOd11/SWjm/QWk70st1/VmI6/et4 IRaad6tHSgLkyPzKKtGCA7csljFugLYsY3jRA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=58hdi6z7ZlZyTvSIm6ukRmd6PdHbk/qiy6BqniuQYhU=; b=XHhSbRX/0djnTsqwZdahszNbztjU+INEUlVWduq581gwq97z7dKJfI0aSoeubhwiD6 BwA91Nzvqi9bPudXehK57MRV6BiaHaVCPVCL2J0utP59331S6vb5GS7b06JhDbQjhEUj Bs3Szr5jb1VkLfoBP1L25E8Hd4MkGHLvsFGp+tpgWgabiUajhRgS+VS/tn7s7YePln8C yhA6G9WPKRmnDMAsBINjdhUTtR1ONw+lKQThDLIvRg8w4urLWv9HWi1OoG3GWFjyTPrR 8ugzCX001pw3j4NBSvk5e3yyF2WfCwDFYxbgR9CKuXdaWVIwGZ39sLEEAd5+npgvGKox tzpQ== X-Gm-Message-State: APt69E0Q/KT9/kNCCf1HpaH01zs3o1veC0Edt44FktvtRoINR8Rj0DFp aI3EZ3YWqa2/FjKmcR2UxZeYRw== X-Received: by 2002:adf:b60d:: with SMTP id f13-v6mr4673161wre.186.1528459840661; Fri, 08 Jun 2018 05:10:40 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:6c67:7ea:9f4d:8968]) by smtp.gmail.com with ESMTPSA id b204-v6sm1546003wmh.22.2018.06.08.05.10.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jun 2018 05:10:40 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: rjw@rjwysocki.net, juri.lelli@redhat.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, patrick.bellasi@arm.com, joel@joelfernandes.org, daniel.lezcano@linaro.org, quentin.perret@arm.com, Vincent Guittot , Ingo Molnar Subject: [PATCH v6 10/11] sched: remove rt_avg code Date: Fri, 8 Jun 2018 14:09:53 +0200 Message-Id: <1528459794-13066-11-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528459794-13066-1-git-send-email-vincent.guittot@linaro.org> References: <1528459794-13066-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rt_avg is no more used anywhere so we can remove all related code Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Vincent Guittot --- kernel/sched/core.c | 26 -------------------------- kernel/sched/fair.c | 2 -- kernel/sched/sched.h | 17 ----------------- 3 files changed, 45 deletions(-) -- 2.7.4 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ab58288..213d277 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -650,23 +650,6 @@ bool sched_can_stop_tick(struct rq *rq) return true; } #endif /* CONFIG_NO_HZ_FULL */ - -void sched_avg_update(struct rq *rq) -{ - s64 period = sched_avg_period(); - - while ((s64)(rq_clock(rq) - rq->age_stamp) > period) { - /* - * Inline assembly required to prevent the compiler - * optimising this loop into a divmod call. - * See __iter_div_u64_rem() for another example of this. - */ - asm("" : "+rm" (rq->age_stamp)); - rq->age_stamp += period; - rq->rt_avg /= 2; - } -} - #endif /* CONFIG_SMP */ #if defined(CONFIG_RT_GROUP_SCHED) || (defined(CONFIG_FAIR_GROUP_SCHED) && \ @@ -5710,13 +5693,6 @@ void set_rq_offline(struct rq *rq) } } -static void set_cpu_rq_start_time(unsigned int cpu) -{ - struct rq *rq = cpu_rq(cpu); - - rq->age_stamp = sched_clock_cpu(cpu); -} - /* * used to mark begin/end of suspend/resume: */ @@ -5834,7 +5810,6 @@ static void sched_rq_cpu_starting(unsigned int cpu) int sched_cpu_starting(unsigned int cpu) { - set_cpu_rq_start_time(cpu); sched_rq_cpu_starting(cpu); sched_tick_start(cpu); return 0; @@ -6102,7 +6077,6 @@ void __init sched_init(void) #ifdef CONFIG_SMP idle_thread_set_boot_cpu(); - set_cpu_rq_start_time(smp_processor_id()); #endif init_sched_fair_class(); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fefd71b..3594692 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5323,8 +5323,6 @@ static void cpu_load_update(struct rq *this_rq, unsigned long this_load, this_rq->cpu_load[i] = (old_load * (scale - 1) + new_load) >> i; } - - sched_avg_update(this_rq); } /* Used instead of source_load when we know the type == 0 */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 873b567..1faab06 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -846,8 +846,6 @@ struct rq { struct list_head cfs_tasks; - u64 rt_avg; - u64 age_stamp; struct sched_avg avg_rt; struct sched_avg avg_dl; #if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) @@ -1712,11 +1710,6 @@ extern const_debug unsigned int sysctl_sched_time_avg; extern const_debug unsigned int sysctl_sched_nr_migrate; extern const_debug unsigned int sysctl_sched_migration_cost; -static inline u64 sched_avg_period(void) -{ - return (u64)sysctl_sched_time_avg * NSEC_PER_MSEC / 2; -} - #ifdef CONFIG_SCHED_HRTICK /* @@ -1753,8 +1746,6 @@ unsigned long arch_scale_freq_capacity(int cpu) #endif #ifdef CONFIG_SMP -extern void sched_avg_update(struct rq *rq); - #ifndef arch_scale_cpu_capacity static __always_inline unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) @@ -1765,12 +1756,6 @@ unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) return SCHED_CAPACITY_SCALE; } #endif - -static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta) -{ - rq->rt_avg += rt_delta * arch_scale_freq_capacity(cpu_of(rq)); - sched_avg_update(rq); -} #else #ifndef arch_scale_cpu_capacity static __always_inline @@ -1779,8 +1764,6 @@ unsigned long arch_scale_cpu_capacity(void __always_unused *sd, int cpu) return SCHED_CAPACITY_SCALE; } #endif -static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta) { } -static inline void sched_avg_update(struct rq *rq) { } #endif struct rq *__task_rq_lock(struct task_struct *p, struct rq_flags *rf)