All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Christoph Lameter <cl@linux.com>, Ingo Molnar <mingo@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Rik van Riel <riel@redhat.com>
Subject: [PATCH 7/7] sched-clock: Migrate to use new tick dependency mask model
Date: Fri, 13 Nov 2015 15:22:09 +0100	[thread overview]
Message-ID: <1447424529-13671-8-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1447424529-13671-1-git-send-email-fweisbec@gmail.com>

Instead of checking sched_clock_stable from the nohz subsystem to verify
its tick dependency, migrate it to the new mask in order to include it
to the all-in-one check.

Cc: Christoph Lameter <cl@linux.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/sched/clock.c     |  5 +++++
 kernel/time/tick-sched.c | 26 ++++++--------------------
 2 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index c0a2051..1389e1a 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -61,6 +61,7 @@
 #include <linux/static_key.h>
 #include <linux/workqueue.h>
 #include <linux/compiler.h>
+#include <linux/tick.h>
 
 /*
  * Scheduler clock - returns current time in nanosec units.
@@ -89,6 +90,8 @@ static void __set_sched_clock_stable(void)
 {
 	if (!sched_clock_stable())
 		static_key_slow_inc(&__sched_clock_stable);
+
+	tick_nohz_clear_dep(TICK_CLOCK_UNSTABLE_BIT);
 }
 
 void set_sched_clock_stable(void)
@@ -108,6 +111,8 @@ static void __clear_sched_clock_stable(struct work_struct *work)
 	/* XXX worry about clock continuity */
 	if (sched_clock_stable())
 		static_key_slow_dec(&__sched_clock_stable);
+
+	tick_nohz_set_dep(TICK_CLOCK_UNSTABLE_BIT);
 }
 
 static DECLARE_WORK(sched_clock_work, __clear_sched_clock_stable);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 2a1ce82..bc419f84 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -174,8 +174,13 @@ static void trace_tick_dependency(unsigned long dep)
 		return;
 	}
 
-	if (dep & TICK_CLOCK_UNSTABLE_MASK)
+#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
+	if (dep & TICK_CLOCK_UNSTABLE_MASK) {
 		trace_tick_stop(0, "unstable sched clock\n");
+		WARN_ONCE(tick_nohz_full_running,
+			  "NO_HZ FULL will not work with unstable sched clock");
+	}
+#endif
 }
 
 static bool can_stop_full_tick(struct tick_sched *ts)
@@ -202,25 +207,6 @@ static bool can_stop_full_tick(struct tick_sched *ts)
 		return false;
 	}
 
-#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
-	/*
-	 * sched_clock_tick() needs us?
-	 *
-	 * TODO: kick full dynticks CPUs when
-	 * sched_clock_stable is set.
-	 */
-	if (!sched_clock_stable()) {
-		trace_tick_stop(0, "unstable sched clock\n");
-		/*
-		 * Don't allow the user to think they can get
-		 * full NO_HZ with this machine.
-		 */
-		WARN_ONCE(tick_nohz_full_running,
-			  "NO_HZ FULL will not work with unstable sched clock");
-		return false;
-	}
-#endif
-
 	return true;
 }
 
-- 
2.5.3


      parent reply	other threads:[~2015-11-13 14:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 14:22 [PATCH 0/7] nohz: Tick dependency mask v3 Frederic Weisbecker
2015-11-13 14:22 ` [PATCH 1/7] atomic: Export fetch_or() Frederic Weisbecker
2015-11-24 15:58   ` Chris Metcalf
2015-11-24 21:19     ` Frederic Weisbecker
2015-11-24 21:48       ` Chris Metcalf
2015-11-30 17:36         ` Frederic Weisbecker
2015-11-30 18:17           ` Chris Metcalf
2015-11-25  9:13       ` Peter Zijlstra
2015-11-13 14:22 ` [PATCH 2/7] nohz: New tick dependency mask Frederic Weisbecker
2015-11-24 16:19   ` Chris Metcalf
2015-11-25 11:32     ` Frederic Weisbecker
2015-12-01 20:41   ` Peter Zijlstra
2015-12-01 22:20     ` Frederic Weisbecker
2015-12-02 10:56       ` Peter Zijlstra
2015-12-02 14:08         ` Frederic Weisbecker
2015-12-02 15:09           ` Peter Zijlstra
2015-12-08 15:57             ` Frederic Weisbecker
2015-12-02 12:45       ` Peter Zijlstra
2015-12-02 14:10         ` Frederic Weisbecker
2015-12-02 12:48       ` Peter Zijlstra
2015-12-02 14:11         ` Frederic Weisbecker
2015-11-13 14:22 ` [PATCH 3/7] perf: Migrate perf to use new tick dependency mask model Frederic Weisbecker
2015-11-24 16:19   ` Chris Metcalf
2015-11-25 12:34     ` Frederic Weisbecker
2015-12-02 16:17       ` Peter Zijlstra
2015-12-02 17:03         ` Frederic Weisbecker
2015-12-02 17:15           ` Peter Zijlstra
2015-11-13 14:22 ` [PATCH 4/7] sched: Account rr and fifo tasks separately Frederic Weisbecker
2015-12-02 12:53   ` Peter Zijlstra
2015-12-02 14:16     ` Frederic Weisbecker
2015-11-13 14:22 ` [PATCH 5/7] sched: Migrate sched to use new tick dependency mask model Frederic Weisbecker
2015-11-13 14:22 ` [PATCH 6/7] posix-cpu-timers: Migrate " Frederic Weisbecker
2015-11-13 14:22 ` Frederic Weisbecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447424529-13671-8-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=cl@linux.com \
    --cc=cmetcalf@ezchip.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.