hrtimer.c (9b031c86506cef9acae45e61339fcf9deaabb793) hrtimer.c (af5a06b582ec3d7b0160b4faaa65f73d8dcf989f)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de>
4 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar
5 * Copyright(C) 2006-2007 Timesys Corp., Thomas Gleixner
6 *
7 * High-resolution kernel timers
8 *

--- 121 unchanged lines hidden (view full) ---

130#ifdef CONFIG_SMP
131
132/*
133 * We require the migration_base for lock_hrtimer_base()/switch_hrtimer_base()
134 * such that hrtimer_callback_running() can unconditionally dereference
135 * timer->base->cpu_base
136 */
137static struct hrtimer_cpu_base migration_cpu_base = {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de>
4 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar
5 * Copyright(C) 2006-2007 Timesys Corp., Thomas Gleixner
6 *
7 * High-resolution kernel timers
8 *

--- 121 unchanged lines hidden (view full) ---

130#ifdef CONFIG_SMP
131
132/*
133 * We require the migration_base for lock_hrtimer_base()/switch_hrtimer_base()
134 * such that hrtimer_callback_running() can unconditionally dereference
135 * timer->base->cpu_base
136 */
137static struct hrtimer_cpu_base migration_cpu_base = {
138 .clock_base = { { .cpu_base = &migration_cpu_base, }, },
138 .clock_base = { {
139 .cpu_base = &migration_cpu_base,
140 .seq = SEQCNT_RAW_SPINLOCK_ZERO(migration_cpu_base.seq,
141 &migration_cpu_base.lock),
142 }, },
139};
140
141#define migration_base migration_cpu_base.clock_base[0]
142
143static inline bool is_migration_base(struct hrtimer_clock_base *base)
144{
145 return base == &migration_base;
146}

--- 1846 unchanged lines hidden (view full) ---

1993 * Functions related to boot-time initialization:
1994 */
1995int hrtimers_prepare_cpu(unsigned int cpu)
1996{
1997 struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
1998 int i;
1999
2000 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
143};
144
145#define migration_base migration_cpu_base.clock_base[0]
146
147static inline bool is_migration_base(struct hrtimer_clock_base *base)
148{
149 return base == &migration_base;
150}

--- 1846 unchanged lines hidden (view full) ---

1997 * Functions related to boot-time initialization:
1998 */
1999int hrtimers_prepare_cpu(unsigned int cpu)
2000{
2001 struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
2002 int i;
2003
2004 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
2001 cpu_base->clock_base[i].cpu_base = cpu_base;
2002 timerqueue_init_head(&cpu_base->clock_base[i].active);
2005 struct hrtimer_clock_base *clock_b = &cpu_base->clock_base[i];
2006
2007 clock_b->cpu_base = cpu_base;
2008 seqcount_raw_spinlock_init(&clock_b->seq, &cpu_base->lock);
2009 timerqueue_init_head(&clock_b->active);
2003 }
2004
2005 cpu_base->cpu = cpu;
2006 cpu_base->active_bases = 0;
2007 cpu_base->hres_active = 0;
2008 cpu_base->hang_detected = 0;
2009 cpu_base->next_timer = NULL;
2010 cpu_base->softirq_next_timer = NULL;

--- 208 unchanged lines hidden ---
2010 }
2011
2012 cpu_base->cpu = cpu;
2013 cpu_base->active_bases = 0;
2014 cpu_base->hres_active = 0;
2015 cpu_base->hang_detected = 0;
2016 cpu_base->next_timer = NULL;
2017 cpu_base->softirq_next_timer = NULL;

--- 208 unchanged lines hidden ---