Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199195

Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick dependency mask model

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick dependency mask model
Date 2015-08-03 21:10 +0200
Message-ID <pTthw-3DC-17@gated-at.bofh.it> (permalink)
References (5 earlier) <pS202-83R-5@gated-at.bofh.it> <pS29I-8f1-3@gated-at.bofh.it> <pSjWW-xJ-11@gated-at.bofh.it> <pTrz4-17w-29@gated-at.bofh.it> <pTrSq-1uf-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 03, 2015 at 07:39:37PM +0200, Frederic Weisbecker wrote:
> On Mon, Aug 03, 2015 at 07:12:43PM +0200, Peter Zijlstra wrote:
> > On Fri, Jul 31, 2015 at 04:49:55PM +0200, Frederic Weisbecker wrote:
> > > Instead of doing a per signal dependency, I'm going to use a per task
> > > one.
> > 
> > Urgh, does this mean you'll keep the horrid tick_nohz_task_switch()
> > thing?
> 
> I thought I would drop it, but now that I think about it more, I think I
> need to keep it because if we enqueue a posix timer to a sleeping task
> and that task later wakes up, we must restart the tick, and that is only
> possible with a check on context switch :-(
> 
> This current patchset removed the need for that with a global dependency
> for posix timers: as long as there is one enqueued we keep the tick. But
> Chris and Luiz fear that Tilera users have posix timers on housekeepers.
> They also suggested we offline the posix timers. I fear it's going to be
> a high overhead as it means polling on the target task context of execution.
> Unless we move the task itself to housekeepers...

At least do something like the below, that irq save/restore is expensive
and can be trivially avoided.

Also, tick_nohz_full_kick() checks that tick_nohz_full_cpu() thing
again.

---
 kernel/sched/core.c      | 2 +-
 kernel/time/tick-sched.c | 9 +--------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4d34035bb3ee..57d1af7c0660 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2471,6 +2471,7 @@ static struct rq *finish_task_switch(struct task_struct *prev)
 	vtime_task_switch(prev);
 	finish_arch_switch(prev);
 	perf_event_task_sched_in(prev, current);
+	tick_nohz_task_switch();
 	finish_lock_switch(rq, prev);
 	finish_arch_post_lock_switch();
 
@@ -2489,7 +2490,6 @@ static struct rq *finish_task_switch(struct task_struct *prev)
 		put_task_struct(prev);
 	}
 
-	tick_nohz_task_switch();
 	return rq;
 }
 
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3319e16f31e5..9f2225ef230c 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -260,18 +260,11 @@ void tick_nohz_full_kick_all(void)
  */
 void __tick_nohz_task_switch(void)
 {
-	unsigned long flags;
-
-	local_irq_save(flags);
-
 	if (!tick_nohz_full_cpu(smp_processor_id()))
-		goto out;
+		return;
 
 	if (tick_nohz_tick_stopped() && !can_stop_full_tick())
 		tick_nohz_full_kick();
-
-out:
-	local_irq_restore(flags);
 }
 
 /* Parse the boot-time nohz CPU list from the kernel parameters. */
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Frederic Weisbecker <fweisbec@gmail.com> - 2015-07-29 15:30 +0200
  Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Luiz Capitulino <lcapitulino@redhat.com> - 2015-07-30 16:40 +0200
    Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Frederic Weisbecker <fweisbec@gmail.com> - 2015-07-30 16:50 +0200
  Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Chris Metcalf <cmetcalf@ezchip.com> - 2015-07-30 21:40 +0200
    Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Frederic Weisbecker <fweisbec@gmail.com> - 2015-07-30 21:50 +0200
      Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Chris Metcalf <cmetcalf@ezchip.com> - 2015-07-30 22:00 +0200
        Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Chris Metcalf <cmetcalf@ezchip.com> - 2015-08-03 18:00 +0200
          Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Frederic Weisbecker <fweisbec@gmail.com> - 2015-08-03 20:10 +0200
        Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Peter Zijlstra <peterz@infradead.org> - 2015-08-03 19:20 +0200
          Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Frederic Weisbecker <fweisbec@gmail.com> - 2015-08-03 19:40 +0200
            Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick  dependency mask model Peter Zijlstra <peterz@infradead.org> - 2015-08-03 21:10 +0200

csiph-web