Skip to content

Commit 4f49b90

Browse files
committed
sched-clock: Migrate to use new tick dependency mask model
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. Reviewed-by: Chris Metcalf <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Luiz Capitulino <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Viresh Kumar <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent b787830 commit 4f49b90

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

kernel/sched/clock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include <linux/static_key.h>
6262
#include <linux/workqueue.h>
6363
#include <linux/compiler.h>
64+
#include <linux/tick.h>
6465

6566
/*
6667
* Scheduler clock - returns current time in nanosec units.
@@ -89,6 +90,8 @@ static void __set_sched_clock_stable(void)
8990
{
9091
if (!sched_clock_stable())
9192
static_key_slow_inc(&__sched_clock_stable);
93+
94+
tick_dep_clear(TICK_DEP_BIT_CLOCK_UNSTABLE);
9295
}
9396

9497
void set_sched_clock_stable(void)
@@ -108,6 +111,8 @@ static void __clear_sched_clock_stable(struct work_struct *work)
108111
/* XXX worry about clock continuity */
109112
if (sched_clock_stable())
110113
static_key_slow_dec(&__sched_clock_stable);
114+
115+
tick_dep_set(TICK_DEP_BIT_CLOCK_UNSTABLE);
111116
}
112117

113118
static DECLARE_WORK(sched_clock_work, __clear_sched_clock_stable);

kernel/time/tick-sched.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,6 @@ static bool can_stop_full_tick(struct tick_sched *ts)
204204
return false;
205205
}
206206

207-
#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
208-
/*
209-
* sched_clock_tick() needs us?
210-
*
211-
* TODO: kick full dynticks CPUs when
212-
* sched_clock_stable is set.
213-
*/
214-
if (!sched_clock_stable()) {
215-
trace_tick_stop(0, TICK_DEP_MASK_CLOCK_UNSTABLE);
216-
/*
217-
* Don't allow the user to think they can get
218-
* full NO_HZ with this machine.
219-
*/
220-
WARN_ONCE(tick_nohz_full_running,
221-
"NO_HZ FULL will not work with unstable sched clock");
222-
return false;
223-
}
224-
#endif
225-
226207
return true;
227208
}
228209

0 commit comments

Comments
 (0)