From patchwork Fri May 25 13:12:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 136863 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3574156lji; Fri, 25 May 2018 06:13:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpHdlDiTs8r6vxmr6A29YZtIxH9Nvs7h69QzP+jeS4IqcGclBn8OA7XHiIpAbQWyS8q0Slq X-Received: by 2002:a62:399c:: with SMTP id u28-v6mr2554445pfj.95.1527254009262; Fri, 25 May 2018 06:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527254009; cv=none; d=google.com; s=arc-20160816; b=pWL5TfQnGJblo4g3sJxPlW0Y7MdgS8PAtTXG8kS/FKLnAJn3oxOaOMHf+dHVs9/5TQ wSPmJgI5acLVZWvJBiwwmnEZszcsc8WClJVH9b9BUlkQHYJrEyzqlYioI9MAXy7yIvf/ 4PX9W5BboS+hML+D0YZOQ66/ShVceO2ZoUI3MnJ5qQSgvKZPI7oH5daaYww05VjcrYDL Cw6qOWpLgo0lX0mo321Fn82fHcElYs8CzBu2/koMTa3EimoMmZ4klStauY/azG9z6Ll/ jtHXmgfKmO1laWsus7Nz9g+eQkbotitsVt8NspBv1WaaTNgDxKKb7DPX7hIPP22UPMSu HvdQ== 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=Vu8j+hEom/7KHGLFFSdDkvlDJbms8n0XGAtqTkz4KXU=; b=BDQgd3tGfU4r0i3piKVi5un/T8AEF5aXQ2o6k9b5Rl+2D8COUlUD1dyn2ImKaPNKN8 g20fQvMeRNwjeUh/647anhszJUm2H1RlyX5/TwsTvBuwVlj2PwvcZcjG2D2fBwOC+Ti1 O84quha1+yHwrj/ihOWBEG19V7xTz5l36T9xZoHnM2C13nUBWwgk4MBLAD9w397mBngx K9MYmyaVgDzcGsaZUzi6aiqay8DIP4ucpqaaOs5u6nmxvk4dun0B2S1VuqR/YxdgBWjD a+osIV8D340rSOPuk7JKp0IDQLtKRbbB9m8XLCadf6kae1UEkf7l4K4W7JXMklVNL6LU m0Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MnWzjVVr; 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 f3-v6si24301940plf.436.2018.05.25.06.13.27; Fri, 25 May 2018 06:13:29 -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=MnWzjVVr; 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 S936111AbeEYNNY (ORCPT + 30 others); Fri, 25 May 2018 09:13:24 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54313 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935768AbeEYNMu (ORCPT ); Fri, 25 May 2018 09:12:50 -0400 Received: by mail-wm0-f68.google.com with SMTP id f6-v6so14299316wmc.4 for ; Fri, 25 May 2018 06:12:49 -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=Vu8j+hEom/7KHGLFFSdDkvlDJbms8n0XGAtqTkz4KXU=; b=MnWzjVVrtHXeC5AJi48XaUwakle5THp3aPVSoVtiJRVXt9yE6HCsh7yF+VA8orMq64 ZWw59X+cdzSqG/LaSo9INZ9hEgxR200tC6kbHz8ztivOgDqL7b0c/85OJMxT3Zo+QABo BkfWvBHClvdDDByu2ZXDzHHs8TEFjwKtN7nYg= 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=Vu8j+hEom/7KHGLFFSdDkvlDJbms8n0XGAtqTkz4KXU=; b=dWo/nxIaAaZPjbEVJ+K2FVmU6O/Ed2M3U1XkkoeTzZB68ad+KRrXAG7elr7JmQNanW 2wIixN4Zo2IhaSFKX8xu6bxgNhf1J0kL6fPqXN4gEvdHLxaHiLTCSZ8P4mmhhEugsooz 6CDnhWSna56LRBrGy+FUCNKFDWS4b3/H9ubrChz6QQF6WeafkaxHkLzb+Fycd1CuIlxu H31NvZ8u5Wb/93j8xKtX/HV/0FcX2wjw3h1yjfR1EDXyKntlyD8bA7A6mgqDPOXKGdjc zEIt/MGOo4RE9UIBt7OCNO1TeKqFU/4fJ0uGR7nN74++MQcjsHbefvwgQZiqiUkvM5Wb E4jA== X-Gm-Message-State: ALKqPwdx628ISpiZ+PG68pMF3OwYMrBK4yB6IUYcQTMGVvKVE5VPKvrm CNNPW+5bgzGSRSGl52jIoVOmsA== X-Received: by 2002:a1c:e54a:: with SMTP id c71-v6mr1584157wmh.55.1527253969182; Fri, 25 May 2018 06:12:49 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:a860:64b4:335b:c763]) by smtp.gmail.com with ESMTPSA id 4-v6sm9690948wmg.8.2018.05.25.06.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 06:12:48 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net Cc: juri.lelli@redhat.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, quentin.perret@arm.com, Vincent Guittot Subject: [PATCH v5 09/10] sched: remove rt_avg code Date: Fri, 25 May 2018 15:12:30 +0200 Message-Id: <1527253951-22709-10-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> References: <1527253951-22709-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 Signed-off-by: Vincent Guittot --- kernel/sched/core.c | 26 -------------------------- kernel/sched/sched.h | 17 ----------------- 2 files changed, 43 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/sched.h b/kernel/sched/sched.h index 718c55d..1929db7 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; struct sched_avg avg_irq; @@ -1710,11 +1708,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 /* @@ -1751,8 +1744,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) @@ -1763,12 +1754,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 @@ -1777,8 +1762,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)