Re: [patch] timer: Fix timers_update_migration(), and call it in tmigr_init()
From: Paul E. McKenney
Date: Sat Apr 29 2017 - 17:46:13 EST
On Sat, Apr 29, 2017 at 08:20:33PM +0200, Mike Galbraith wrote:
> On Sat, 2017-04-29 at 11:06 -0700, Paul E. McKenney wrote:
>
> > If someone will either repost a fresh series or point me at exactly
> > the set of patches to use, I will run it through rcutorture again.
>
> Patchlet is against x86-tip/master.today.
So today's (as in Saturday April 29) x86-tip/master with the following
patch applied?
Thanx, Paul
------------------------------------------------------------------------
timers_update_migration() is called by tick_nohz_activate() before
the late initcall tmigr_init() sets tmigr_enabled to true, resulting
in it updating neither timer_base.nohz_active nor .migration_enabled,
meaning we'll not kick an idling cpu in add_timer_on().
Remove redundant loop avoidance such that tick_nohz_activate() updates
timer_bases[].nohz_active as intended, and call it in tmigr_init() to
update timer_bases[].migration_enabled.
Signed-off-by: Mike Galbraith <efault@xxxxxx>
Fixes: ec2206b91d43 timer: Implement the hierarchical pull model
---
kernel/time/timer.c | 4 ----
kernel/time/timer_migration.c | 1 +
2 files changed, 1 insertion(+), 4 deletions(-)
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -224,10 +224,6 @@ void timers_update_migration(bool update
bool on = sysctl_timer_migration && tick_nohz_active && tmigr_enabled;
unsigned int cpu;
- /* Avoid the loop, if nothing to update */
- if (this_cpu_read(timer_bases[BASE_GLOBAL].migration_enabled) == on)
- return;
-
for_each_possible_cpu(cpu) {
per_cpu(timer_bases[BASE_LOCAL].migration_enabled, cpu) = on;
per_cpu(timer_bases[BASE_GLOBAL].migration_enabled, cpu) = on;
--- a/kernel/time/timer_migration.c
+++ b/kernel/time/timer_migration.c
@@ -649,6 +649,7 @@ static int __init tmigr_init(void)
goto hp_err;
tmigr_enabled = true;
+ timers_update_migration(false);
pr_info("Timer migration: %d hierarchy levels\n", tmigr_hierarchy_levels);
return 0;