Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1206637 > unrolled thread
| Started by | Vatika Harlalka <vatikaharlalka@gmail.com> |
|---|---|
| First post | 2015-08-13 11:30 +0200 |
| Last post | 2015-08-13 21:30 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Vatika Harlalka <vatikaharlalka@gmail.com> - 2015-08-13 11:30 +0200
[PATCH 1/2] nohz_full: Move tick related code to tick.c Vatika Harlalka <vatikaharlalka@gmail.com> - 2015-08-13 11:30 +0200
Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Peter Zijlstra <peterz@infradead.org> - 2015-08-13 14:30 +0200
Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Frederic Weisbecker <fweisbec@gmail.com> - 2015-08-13 14:50 +0200
Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Peter Zijlstra <peterz@infradead.org> - 2015-08-13 17:10 +0200
Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Frederic Weisbecker <fweisbec@gmail.com> - 2015-08-13 17:40 +0200
Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus Vatika Harlalka <vatikaharlalka@gmail.com> - 2015-08-13 21:30 +0200
| From | Vatika Harlalka <vatikaharlalka@gmail.com> |
|---|---|
| Date | 2015-08-13 11:30 +0200 |
| Subject | [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pWWZH-7z0-1@gated-at.bofh.it> |
This patchset is for offloading task_tick() to a remote housekeeping cpu. The larger aim is to stop ticks on nohz_full cpus. For this, extra work must be done by housekeeping cpus. So, task_tick is called from a delayed workqueue for nohz_full cpus and the work is requeued every second for those nohz_full cpus whose ticks are stopped while they are busy. In the rest of the cases it will lead to redundant accounting. To facilitate this, a new function tick_nohz_remote_tick_stopped is added to indicate whether ticks are stopped on a remote cpu. Tick related code in core.c is moved to tick.c Vatika Harlalka (2): nohz_full: Move tick related code to tick.c nohz_full: Offload task_tick to remote housekeeping cpu include/linux/tick.h | 2 ++ kernel/sched/Makefile | 2 +- kernel/sched/core.c | 27 --------------- kernel/sched/tick.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ kernel/time/tick-sched.c | 5 +++ 5 files changed, 93 insertions(+), 28 deletions(-) create mode 100644 kernel/sched/tick.c -- 2.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Vatika Harlalka <vatikaharlalka@gmail.com> |
|---|---|
| Date | 2015-08-13 11:30 +0200 |
| Subject | [PATCH 1/2] nohz_full: Move tick related code to tick.c |
| Message-ID | <pWWZJ-7z0-23@gated-at.bofh.it> |
| In reply to | #1206637 |
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@gmail.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-08-13 14:30 +0200 |
| Subject | Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pWZNV-3cO-59@gated-at.bofh.it> |
| In reply to | #1206637 |
On Thu, Aug 13, 2015 at 02:55:36PM +0530, Vatika Harlalka wrote: > This patchset is for offloading task_tick() to a remote housekeeping > cpu. The larger aim is to stop ticks on nohz_full cpus. For this, extra > work must be done by housekeeping cpus. So, task_tick is called from a > delayed workqueue for nohz_full cpus and the work is requeued every second > for those nohz_full cpus whose ticks are stopped while they are busy. In > the rest of the cases it will lead to redundant accounting. To facilitate > this, a new function tick_nohz_remote_tick_stopped is added to indicate > whether ticks are stopped on a remote cpu. > Tick related code in core.c is moved to tick.c *sigh* of course you didn't read what I've written on this topic.. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| Date | 2015-08-13 14:50 +0200 |
| Subject | Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pX07h-3zv-35@gated-at.bofh.it> |
| In reply to | #1206777 |
On Thu, Aug 13, 2015 at 02:22:23PM +0200, Peter Zijlstra wrote: > On Thu, Aug 13, 2015 at 02:55:36PM +0530, Vatika Harlalka wrote: > > This patchset is for offloading task_tick() to a remote housekeeping > > cpu. The larger aim is to stop ticks on nohz_full cpus. For this, extra > > work must be done by housekeeping cpus. So, task_tick is called from a > > delayed workqueue for nohz_full cpus and the work is requeued every second > > for those nohz_full cpus whose ticks are stopped while they are busy. In > > the rest of the cases it will lead to redundant accounting. To facilitate > > this, a new function tick_nohz_remote_tick_stopped is added to indicate > > whether ticks are stopped on a remote cpu. > > Tick related code in core.c is moved to tick.c > > *sigh* of course you didn't read what I've written on this topic.. What is it? Note Vatika wrote this after my suggestion, so if there is an issue, I'm likely the responsible :-) But I don't recall you opposed to this solution. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-08-13 17:10 +0200 |
| Subject | Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pX2iK-6SM-31@gated-at.bofh.it> |
| In reply to | #1206789 |
On Thu, Aug 13, 2015 at 02:44:02PM +0200, Frederic Weisbecker wrote: > On Thu, Aug 13, 2015 at 02:22:23PM +0200, Peter Zijlstra wrote: > > On Thu, Aug 13, 2015 at 02:55:36PM +0530, Vatika Harlalka wrote: > > > This patchset is for offloading task_tick() to a remote housekeeping > > > cpu. The larger aim is to stop ticks on nohz_full cpus. For this, extra > > > work must be done by housekeeping cpus. So, task_tick is called from a > > > delayed workqueue for nohz_full cpus and the work is requeued every second > > > for those nohz_full cpus whose ticks are stopped while they are busy. In > > > the rest of the cases it will lead to redundant accounting. To facilitate > > > this, a new function tick_nohz_remote_tick_stopped is added to indicate > > > whether ticks are stopped on a remote cpu. > > > Tick related code in core.c is moved to tick.c > > > > *sigh* of course you didn't read what I've written on this topic.. > > What is it? Note Vatika wrote this after my suggestion, so if there is an issue, > I'm likely the responsible :-) But I don't recall you opposed to this solution. *sigh* of course you _could_ all use Google yourselves. Re-read: https://patches.linaro.org/28290/ I see nothing like the stuff I asked for in here, on top it creates the stupid tick.c file. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Frederic Weisbecker <fweisbec@gmail.com> |
|---|---|
| Date | 2015-08-13 17:40 +0200 |
| Subject | Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pX2LM-7qM-19@gated-at.bofh.it> |
| In reply to | #1206899 |
On Thu, Aug 13, 2015 at 05:05:45PM +0200, Peter Zijlstra wrote: > On Thu, Aug 13, 2015 at 02:44:02PM +0200, Frederic Weisbecker wrote: > > On Thu, Aug 13, 2015 at 02:22:23PM +0200, Peter Zijlstra wrote: > > > On Thu, Aug 13, 2015 at 02:55:36PM +0530, Vatika Harlalka wrote: > > > > This patchset is for offloading task_tick() to a remote housekeeping > > > > cpu. The larger aim is to stop ticks on nohz_full cpus. For this, extra > > > > work must be done by housekeeping cpus. So, task_tick is called from a > > > > delayed workqueue for nohz_full cpus and the work is requeued every second > > > > for those nohz_full cpus whose ticks are stopped while they are busy. In > > > > the rest of the cases it will lead to redundant accounting. To facilitate > > > > this, a new function tick_nohz_remote_tick_stopped is added to indicate > > > > whether ticks are stopped on a remote cpu. > > > > Tick related code in core.c is moved to tick.c > > > > > > *sigh* of course you didn't read what I've written on this topic.. > > > > What is it? Note Vatika wrote this after my suggestion, so if there is an issue, > > I'm likely the responsible :-) But I don't recall you opposed to this solution. > > *sigh* of course you _could_ all use Google yourselves. > > Re-read: https://patches.linaro.org/28290/ Sorry, there were dozens of threads about this issue and I got a bit confused. > > I see nothing like the stuff I asked for in here, on top it creates the > stupid tick.c file. Right. I initially thought that we should make sched_tick() just work with long delays. Then tglx suggested the offline idea but I lost track about our conversation. But yeah making that scheduler_tick() working with long delays sound much better. Certainly much more work but that's a natural evolution after all. It should pay in longer term. We can start with update_cpu_load_active() which only works with HZ frequency updates or nohz idle zero load decay. Now I think that stuff is only used for load balancing. I had hopes this thing could be removed. I think Alex Shin (IIRC) tried but the patchset didn't make it. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vatika Harlalka <vatikaharlalka@gmail.com> |
|---|---|
| Date | 2015-08-13 21:30 +0200 |
| Subject | Re: [PATCH 0/2] nohz_full: Offload task_tick to remote housekeeping cpus for nohz_full cpus |
| Message-ID | <pX6mm-4hD-9@gated-at.bofh.it> |
| In reply to | #1206924 |
Hi Peter :) I'm very sorry about this. I should've gone through what was written on the topic before attempting to write this patch. I'll go through the link and work on what is discussed to make a new relevant patch. Thanks Vatika -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web