lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Aug 2015 14:55:45 +0530
From:	Vatika Harlalka <vatikaharlalka@...il.com>
To:	mingo@...hat.com, peterz@...radead.org, tglx@...utronix.de,
	rafael.j.wysocki@...el.com, fweisbec@...il.com,
	schwidefsky@...ibm.com, linux-kernel@...r.kernel.org,
	preetium@...rew.cmu.edu
Cc:	preeti.murthy@...il.com
Subject: [PATCH 1/2] nohz_full: Move tick related code to tick.c

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 <vatikaharlalka@...il.com>
---
 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 <linux/smp.h>
+#include <linux/cpumask.h>
+#include <linux/tick.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+#include <linux/percpu.h>
+#include <linux/perf_event.h>
+#include <linux/workqueue.h>
+#include <linux/jiffies.h>
+#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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ