From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752417AbbHMJZn (ORCPT ); Thu, 13 Aug 2015 05:25:43 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33826 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228AbbHMJZl (ORCPT ); Thu, 13 Aug 2015 05:25:41 -0400 Date: Thu, 13 Aug 2015 14:55:45 +0530 From: Vatika Harlalka To: mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, rafael.j.wysocki@intel.com, fweisbec@gmail.com, schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org, preetium@andrew.cmu.edu Cc: preeti.murthy@gmail.com Subject: [PATCH 1/2] nohz_full: Move tick related code to tick.c Message-ID: <9fe1d890ce20e976a585fd8dddd8d2ee2220ca75.1439454836.git.vatikaharlalka@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Offloading task_tick off nohz_full cpus introduces tick related code in the scheduler code. It is therefore better to create a new file tick.c and move the existing tick related code there. Signed-off-by: Vatika Harlalka --- kernel/sched/Makefile | 2 +- kernel/sched/core.c | 27 --------------------------- kernel/sched/tick.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 kernel/sched/tick.c diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index 46be870..3b31182 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -11,7 +11,7 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) CFLAGS_core.o := $(PROFILING) -fno-omit-frame-pointer endif -obj-y += core.o proc.o clock.o cputime.o +obj-y += core.o proc.o clock.o cputime.o tick.o obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o obj-y += wait.o completion.o idle.o obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 57bd333..64beceb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2481,33 +2481,6 @@ unsigned long long task_sched_runtime(struct task_struct *p) return ns; } -/* - * This function gets called by the timer code, with HZ frequency. - * We call it with interrupts disabled. - */ -void scheduler_tick(void) -{ - int cpu = smp_processor_id(); - struct rq *rq = cpu_rq(cpu); - struct task_struct *curr = rq->curr; - - sched_clock_tick(); - - raw_spin_lock(&rq->lock); - update_rq_clock(rq); - curr->sched_class->task_tick(rq, curr, 0); - update_cpu_load_active(rq); - raw_spin_unlock(&rq->lock); - - perf_event_task_tick(); - -#ifdef CONFIG_SMP - rq->idle_balance = idle_cpu(cpu); - trigger_load_balance(rq); -#endif - rq_last_tick_reset(rq); -} - #ifdef CONFIG_NO_HZ_FULL /** * scheduler_tick_max_deferment diff --git a/kernel/sched/tick.c b/kernel/sched/tick.c new file mode 100644 index 0000000..3bc32c7 --- /dev/null +++ b/kernel/sched/tick.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sched.h" + +/* + * This function gets called by the timer code, with HZ frequency. + * We call it with interrupts disabled. + */ + +void scheduler_tick(void) +{ + int cpu = smp_processor_id(); + struct rq *rq = cpu_rq(cpu); + struct task_struct *curr; + + raw_spin_lock(&rq->lock); + curr = rq->curr; + raw_spin_unlock(&rq->lock); + + sched_clock_tick(); + + raw_spin_lock(&rq->lock); + update_rq_clock(rq); + curr->sched_class->task_tick(rq, curr, 0); + update_cpu_load_active(rq); + raw_spin_unlock(&rq->lock); + + perf_event_task_tick(); + +#ifdef CONFIG_SMP + rq->idle_balance = idle_cpu(cpu); + trigger_load_balance(rq); +#endif + rq_last_tick_reset(rq); +} + -- 2.4.2