@@ -1606,11 +1606,21 @@ static int init_timers_cpu(int cpu)
static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head)
{
struct timer_list *timer;
+ int is_pinned;
while (!list_empty(head)) {
timer = list_first_entry(head, struct timer_list, entry);
/* We ignore the accounting on the dying cpu */
detach_timer(timer, false);
+
+ is_pinned = tbase_get_pinned(timer->base);
+
+ /* Check if CPU still has pinned timers */
+ if (unlikely(WARN(is_pinned,
+ "%s: can't migrate pinned timer: %p, deactivating it\n",
+ __func__, timer)))
+ continue;
+
timer_set_base(timer, new_base);
internal_add_timer(new_base, timer);
}
migrate_timer() is called when a CPU goes down and its timers are required to be migrated to some other CPU. Its the responsibility of the users of the timer to remove it before control reaches to migrate_timers(). As these were the pinned timers, the best we can do is: don't migrate these and report to the user as well. That's all this patch does. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- kernel/timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+)