mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
Another set of timer API cleanups:
- Convert init_timer*(), try_to_del_timer_sync() and destroy_timer_on_stack() over to the canonical timer_*() namespace convention. There are is another large converstion pending, which has not been included because it would have caused a gazillion of merge conflicts in next. The conversion scripts will be run towards the end of the merge window and a pull request sent once all conflict dependencies have been merged. -----BEGIN PGP SIGNATURE----- iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmgzgTkTHHRnbHhAbGlu dXRyb25peC5kZQAKCRCmGPVMDXSYodwVD/97rF1Juqm1JZNIZPN/vMqwCxRoUkc6 tsK0+UC7UXusuJadxJ+Bsv25iPF+qejnThMU+SQ5yTVj/PNfxOe0WPdCEGGiL8Ye 2JCk6GqSOB/360SlLmtR1B1xHDwsuuUcQTz0w57CH66HRV5vpoWSMSwj/ypy+8nU PlgjItaxdCKa9NJ+SUJZPWIxRkt/PsA1kwlV1OcxkgB++IiIHQEbPxECq9mlzWXF b4Sq/Sdf2OmEePN+DYoey4fneRwJnkjkeX/o+CqosCPHRIiWUlSu5W/lU5IYojM3 s3XpMNNg/z8PMXR4JA2VaPYWLUZyBOs+3dM7Y6Am+z55EoxMxfzg6pGx2tfM4ftl vF8wG3Z1c9MmpLk+P9LatNvfHeVLNve8KgOLa5phMDQ/El/a8KqLu6HmRDPONvKp d6iXdPq1CP8P6jOtlFfzLmKPShgEcp+Zz9W3CaQR/0ZJEsEqrpKOLzdT86hJhBV0 mBCdzixmGtKAh0BdPdmg2FCLScqER3HKIJhZSdV8I+jSETIHCuMiIfbMXR7iwm/H R1/ayvxrbc1mPseo28scqvo7m6cn5BFBxIUf4Sokp52ZCapz1v2aWzo4vHI0cTgT ZOjlTrf+fgYLn1dqdD45TJiQPnmRrw4dU+WWSFRFJY2qjfyucj80vdqdkE5zkp5b UPomlVimG4ccPg== =FHGU -----END PGP SIGNATURE----- Merge tag 'timers-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer cleanups from Thomas Gleixner: "Another set of timer API cleanups: - Convert init_timer*(), try_to_del_timer_sync() and destroy_timer_on_stack() over to the canonical timer_*() namespace convention. There is another large conversion pending, which has not been included because it would have caused a gazillion of merge conflicts in next. The conversion scripts will be run towards the end of the merge window and a pull request sent once all conflict dependencies have been merged" * tag 'timers-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: treewide, timers: Rename destroy_timer_on_stack() as timer_destroy_on_stack() treewide, timers: Rename try_to_del_timer_sync() as timer_delete_sync_try() timers: Rename init_timers() as timers_init() timers: Rename NEXT_TIMER_MAX_DELTA as TIMER_NEXT_MAX_DELTA timers: Rename __init_timer_on_stack() as __timer_init_on_stack() timers: Rename __init_timer() as __timer_init() timers: Rename init_timer_on_stack_key() as timer_init_key_on_stack() timers: Rename init_timer_key() as timer_init_key()
This commit is contained in:
commit
5e8bbb2caa
@ -572,7 +572,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
|
||||
|
||||
/*
|
||||
* Return the number of jiffies until the next timeout. If the timeout is
|
||||
* longer than the NEXT_TIMER_MAX_DELTA, then return NEXT_TIMER_MAX_DELTA
|
||||
* longer than the TIMER_NEXT_MAX_DELTA, then return TIMER_NEXT_MAX_DELTA
|
||||
* because the larger value can break the timer APIs.
|
||||
*/
|
||||
static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
|
||||
@ -598,7 +598,7 @@ static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
|
||||
if (do_div(nr_jiffies, tb_ticks_per_jiffy))
|
||||
nr_jiffies++;
|
||||
|
||||
return min_t(unsigned long long, nr_jiffies, NEXT_TIMER_MAX_DELTA);
|
||||
return min_t(unsigned long long, nr_jiffies, TIMER_NEXT_MAX_DELTA);
|
||||
}
|
||||
|
||||
static void arm_next_watchdog(struct kvm_vcpu *vcpu)
|
||||
@ -616,10 +616,10 @@ static void arm_next_watchdog(struct kvm_vcpu *vcpu)
|
||||
spin_lock_irqsave(&vcpu->arch.wdt_lock, flags);
|
||||
nr_jiffies = watchdog_next_timeout(vcpu);
|
||||
/*
|
||||
* If the number of jiffies of watchdog timer >= NEXT_TIMER_MAX_DELTA
|
||||
* If the number of jiffies of watchdog timer >= TIMER_NEXT_MAX_DELTA
|
||||
* then do not run the watchdog timer as this can break timer APIs.
|
||||
*/
|
||||
if (nr_jiffies < NEXT_TIMER_MAX_DELTA)
|
||||
if (nr_jiffies < TIMER_NEXT_MAX_DELTA)
|
||||
mod_timer(&vcpu->arch.wdt_timer, jiffies + nr_jiffies);
|
||||
else
|
||||
timer_delete(&vcpu->arch.wdt_timer);
|
||||
|
@ -864,7 +864,7 @@ void lapic_offline(void)
|
||||
__vector_cleanup(cl, false);
|
||||
|
||||
irq_matrix_offline(vector_matrix);
|
||||
WARN_ON_ONCE(try_to_del_timer_sync(&cl->timer) < 0);
|
||||
WARN_ON_ONCE(timer_delete_sync_try(&cl->timer) < 0);
|
||||
WARN_ON_ONCE(!hlist_empty(&cl->head));
|
||||
|
||||
unlock_vector_lock();
|
||||
|
@ -560,7 +560,7 @@ static void dpm_watchdog_clear(struct dpm_watchdog *wd)
|
||||
struct timer_list *timer = &wd->timer;
|
||||
|
||||
timer_delete_sync(timer);
|
||||
destroy_timer_on_stack(timer);
|
||||
timer_destroy_on_stack(timer);
|
||||
}
|
||||
#else
|
||||
#define DECLARE_DPM_WATCHDOG_ON_STACK(wd)
|
||||
|
@ -1312,9 +1312,9 @@ static void __cold try_to_generate_entropy(void)
|
||||
while (!crng_ready() && !signal_pending(current)) {
|
||||
/*
|
||||
* Check !timer_pending() and then ensure that any previous callback has finished
|
||||
* executing by checking try_to_del_timer_sync(), before queueing the next one.
|
||||
* executing by checking timer_delete_sync_try(), before queueing the next one.
|
||||
*/
|
||||
if (!timer_pending(&stack->timer) && try_to_del_timer_sync(&stack->timer) >= 0) {
|
||||
if (!timer_pending(&stack->timer) && timer_delete_sync_try(&stack->timer) >= 0) {
|
||||
struct cpumask timer_cpus;
|
||||
unsigned int num_cpus;
|
||||
|
||||
@ -1354,7 +1354,7 @@ static void __cold try_to_generate_entropy(void)
|
||||
mix_pool_bytes(&stack->entropy, sizeof(stack->entropy));
|
||||
|
||||
timer_delete_sync(&stack->timer);
|
||||
destroy_timer_on_stack(&stack->timer);
|
||||
timer_destroy_on_stack(&stack->timer);
|
||||
}
|
||||
|
||||
|
||||
|
@ -413,7 +413,7 @@ static int test_wait_timeout(void *arg)
|
||||
err = 0;
|
||||
err_free:
|
||||
timer_delete_sync(&wt.timer);
|
||||
destroy_timer_on_stack(&wt.timer);
|
||||
timer_destroy_on_stack(&wt.timer);
|
||||
dma_fence_signal(wt.f);
|
||||
dma_fence_put(wt.f);
|
||||
return err;
|
||||
|
@ -431,7 +431,7 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
|
||||
fw_send_request(card, &t, tcode, destination_id, generation, speed,
|
||||
offset, payload, length, transaction_callback, &d);
|
||||
wait_for_completion(&d.done);
|
||||
destroy_timer_on_stack(&t.split_timeout_timer);
|
||||
timer_destroy_on_stack(&t.split_timeout_timer);
|
||||
|
||||
return d.rcode;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ static int suspend_test_thread(void *arg)
|
||||
* later.
|
||||
*/
|
||||
timer_delete(&wakeup_timer);
|
||||
destroy_timer_on_stack(&wakeup_timer);
|
||||
timer_destroy_on_stack(&wakeup_timer);
|
||||
|
||||
if (atomic_dec_return_relaxed(&nb_active_threads) == 0)
|
||||
complete(&suspend_threads_done);
|
||||
|
@ -261,7 +261,7 @@ static int gud_usb_bulk(struct gud_device *gdrm, size_t len)
|
||||
else if (ctx.sgr.bytes != len)
|
||||
ret = -EIO;
|
||||
|
||||
destroy_timer_on_stack(&ctx.timer);
|
||||
timer_destroy_on_stack(&ctx.timer);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ static int live_emit_pte_full_ring(void *arg)
|
||||
out_rq:
|
||||
i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */
|
||||
timer_delete_sync(&st.timer);
|
||||
destroy_timer_on_stack(&st.timer);
|
||||
timer_destroy_on_stack(&st.timer);
|
||||
out_unpin:
|
||||
intel_context_unpin(ce);
|
||||
out_put:
|
||||
|
@ -77,7 +77,7 @@ void timed_fence_fini(struct timed_fence *tf)
|
||||
if (timer_delete_sync(&tf->timer))
|
||||
i915_sw_fence_commit(&tf->fence);
|
||||
|
||||
destroy_timer_on_stack(&tf->timer);
|
||||
timer_destroy_on_stack(&tf->timer);
|
||||
i915_sw_fence_fini(&tf->fence);
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ static int threaded_ttm_bo_reserve(void *arg)
|
||||
err = ttm_bo_reserve(bo, interruptible, no_wait, &ctx);
|
||||
|
||||
timer_delete_sync(&s_timer.timer);
|
||||
destroy_timer_on_stack(&s_timer.timer);
|
||||
timer_destroy_on_stack(&s_timer.timer);
|
||||
|
||||
ww_acquire_fini(&ctx);
|
||||
|
||||
|
@ -564,7 +564,7 @@ void imsic_state_offline(void)
|
||||
struct imsic_local_priv *lpriv = this_cpu_ptr(imsic->lpriv);
|
||||
|
||||
raw_spin_lock_irqsave(&lpriv->lock, flags);
|
||||
WARN_ON_ONCE(try_to_del_timer_sync(&lpriv->timer) < 0);
|
||||
WARN_ON_ONCE(timer_delete_sync_try(&lpriv->timer) < 0);
|
||||
raw_spin_unlock_irqrestore(&lpriv->lock, flags);
|
||||
#endif
|
||||
}
|
||||
|
@ -3806,7 +3806,7 @@ status);
|
||||
if ((status < 0) && (!probe_fl)) {
|
||||
pvr2_hdw_render_useless(hdw);
|
||||
}
|
||||
destroy_timer_on_stack(&timer.timer);
|
||||
timer_destroy_on_stack(&timer.timer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -3952,7 +3952,7 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter)
|
||||
|
||||
|
||||
timer_delete_sync(&timeout.timer);
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
|
||||
mutex_unlock(&raid_dev->sysfs_mtx);
|
||||
|
||||
|
@ -704,7 +704,7 @@ lld_ioctl(mraid_mmadp_t *adp, uioc_t *kioc)
|
||||
wait_event(wait_q, (kioc->status != -ENODATA));
|
||||
if (timeout.timer.function) {
|
||||
timer_delete_sync(&timeout.timer);
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -611,7 +611,7 @@ static void start_wait_timer(struct wait_info *winfo)
|
||||
static void remove_wait_timer(struct wait_info *winfo)
|
||||
{
|
||||
timer_delete_sync(&winfo->timer);
|
||||
destroy_timer_on_stack(&winfo->timer);
|
||||
timer_destroy_on_stack(&winfo->timer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -598,7 +598,7 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done,
|
||||
mod_timer(&timer.timer, jiffies + msecs_to_jiffies(CMD_TIMEOUT));
|
||||
wait_for_completion(done);
|
||||
timer_delete_sync(&timer.timer);
|
||||
destroy_timer_on_stack(&timer.timer);
|
||||
timer_destroy_on_stack(&timer.timer);
|
||||
|
||||
if (actual_length)
|
||||
*actual_length = urb->actual_length;
|
||||
|
@ -630,7 +630,7 @@ static int perform_sglist(
|
||||
retval = -ETIMEDOUT;
|
||||
else
|
||||
retval = req->status;
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
|
||||
/* FIXME check resulting data pattern */
|
||||
|
||||
|
@ -122,7 +122,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
timer_delete_sync(&wait.cpu_timer);
|
||||
destroy_timer_on_stack(&wait.cpu_timer);
|
||||
timer_destroy_on_stack(&wait.cpu_timer);
|
||||
bch2_io_timer_del(clock, &wait.io_timer);
|
||||
}
|
||||
|
||||
|
@ -67,44 +67,44 @@
|
||||
/*
|
||||
* LOCKDEP and DEBUG timer interfaces.
|
||||
*/
|
||||
void init_timer_key(struct timer_list *timer,
|
||||
void timer_init_key(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *), unsigned int flags,
|
||||
const char *name, struct lock_class_key *key);
|
||||
|
||||
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
|
||||
extern void init_timer_on_stack_key(struct timer_list *timer,
|
||||
extern void timer_init_key_on_stack(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *),
|
||||
unsigned int flags, const char *name,
|
||||
struct lock_class_key *key);
|
||||
#else
|
||||
static inline void init_timer_on_stack_key(struct timer_list *timer,
|
||||
static inline void timer_init_key_on_stack(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *),
|
||||
unsigned int flags,
|
||||
const char *name,
|
||||
struct lock_class_key *key)
|
||||
{
|
||||
init_timer_key(timer, func, flags, name, key);
|
||||
timer_init_key(timer, func, flags, name, key);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#define __init_timer(_timer, _fn, _flags) \
|
||||
#define __timer_init(_timer, _fn, _flags) \
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
init_timer_key((_timer), (_fn), (_flags), #_timer, &__key);\
|
||||
timer_init_key((_timer), (_fn), (_flags), #_timer, &__key);\
|
||||
} while (0)
|
||||
|
||||
#define __init_timer_on_stack(_timer, _fn, _flags) \
|
||||
#define __timer_init_on_stack(_timer, _fn, _flags) \
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
init_timer_on_stack_key((_timer), (_fn), (_flags), \
|
||||
timer_init_key_on_stack((_timer), (_fn), (_flags), \
|
||||
#_timer, &__key); \
|
||||
} while (0)
|
||||
#else
|
||||
#define __init_timer(_timer, _fn, _flags) \
|
||||
init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __init_timer_on_stack(_timer, _fn, _flags) \
|
||||
init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __timer_init(_timer, _fn, _flags) \
|
||||
timer_init_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __timer_init_on_stack(_timer, _fn, _flags) \
|
||||
timer_init_key_on_stack((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -115,18 +115,18 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
|
||||
*
|
||||
* Regular timer initialization should use either DEFINE_TIMER() above,
|
||||
* or timer_setup(). For timers on the stack, timer_setup_on_stack() must
|
||||
* be used and must be balanced with a call to destroy_timer_on_stack().
|
||||
* be used and must be balanced with a call to timer_destroy_on_stack().
|
||||
*/
|
||||
#define timer_setup(timer, callback, flags) \
|
||||
__init_timer((timer), (callback), (flags))
|
||||
__timer_init((timer), (callback), (flags))
|
||||
|
||||
#define timer_setup_on_stack(timer, callback, flags) \
|
||||
__init_timer_on_stack((timer), (callback), (flags))
|
||||
__timer_init_on_stack((timer), (callback), (flags))
|
||||
|
||||
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
|
||||
extern void destroy_timer_on_stack(struct timer_list *timer);
|
||||
extern void timer_destroy_on_stack(struct timer_list *timer);
|
||||
#else
|
||||
static inline void destroy_timer_on_stack(struct timer_list *timer) { }
|
||||
static inline void timer_destroy_on_stack(struct timer_list *timer) { }
|
||||
#endif
|
||||
|
||||
#define from_timer(var, callback_timer, timer_fieldname) \
|
||||
@ -156,19 +156,19 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
|
||||
* The jiffies value which is added to now, when there is no timer
|
||||
* in the timer wheel:
|
||||
*/
|
||||
#define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1)
|
||||
#define TIMER_NEXT_MAX_DELTA ((1UL << 30) - 1)
|
||||
|
||||
extern void add_timer(struct timer_list *timer);
|
||||
extern void add_timer_local(struct timer_list *timer);
|
||||
extern void add_timer_global(struct timer_list *timer);
|
||||
|
||||
extern int try_to_del_timer_sync(struct timer_list *timer);
|
||||
extern int timer_delete_sync_try(struct timer_list *timer);
|
||||
extern int timer_delete_sync(struct timer_list *timer);
|
||||
extern int timer_delete(struct timer_list *timer);
|
||||
extern int timer_shutdown_sync(struct timer_list *timer);
|
||||
extern int timer_shutdown(struct timer_list *timer);
|
||||
|
||||
extern void init_timers(void);
|
||||
extern void timers_init(void);
|
||||
struct hrtimer;
|
||||
extern enum hrtimer_restart it_real_fn(struct hrtimer *);
|
||||
|
||||
|
@ -316,7 +316,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
|
||||
#define __INIT_DELAYED_WORK(_work, _func, _tflags) \
|
||||
do { \
|
||||
INIT_WORK(&(_work)->work, (_func)); \
|
||||
__init_timer(&(_work)->timer, \
|
||||
__timer_init(&(_work)->timer, \
|
||||
delayed_work_timer_fn, \
|
||||
(_tflags) | TIMER_IRQSAFE); \
|
||||
} while (0)
|
||||
@ -324,7 +324,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
|
||||
#define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \
|
||||
do { \
|
||||
INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
|
||||
__init_timer_on_stack(&(_work)->timer, \
|
||||
__timer_init_on_stack(&(_work)->timer, \
|
||||
delayed_work_timer_fn, \
|
||||
(_tflags) | TIMER_IRQSAFE); \
|
||||
} while (0)
|
||||
|
@ -1002,7 +1002,7 @@ void start_kernel(void)
|
||||
init_IRQ();
|
||||
tick_init();
|
||||
rcu_init_nohz();
|
||||
init_timers();
|
||||
timers_init();
|
||||
srcu_init();
|
||||
hrtimers_init();
|
||||
softirq_init();
|
||||
|
@ -1501,7 +1501,7 @@ static int access_thread(void *arg)
|
||||
}
|
||||
} while (!torture_must_stop());
|
||||
timer_delete_sync(&timer);
|
||||
destroy_timer_on_stack(&timer);
|
||||
timer_destroy_on_stack(&timer);
|
||||
|
||||
torture_kthread_stopping("access_thread");
|
||||
return 0;
|
||||
|
@ -2371,7 +2371,7 @@ rcu_torture_reader(void *arg)
|
||||
} while (!torture_must_stop());
|
||||
if (irqreader && cur_ops->irq_capable) {
|
||||
timer_delete_sync(&t);
|
||||
destroy_timer_on_stack(&t);
|
||||
timer_destroy_on_stack(&t);
|
||||
}
|
||||
tick_dep_clear_task(current, TICK_DEP_BIT_RCU);
|
||||
torture_kthread_stopping("rcu_torture_reader");
|
||||
|
@ -100,7 +100,7 @@ signed long __sched schedule_timeout(signed long timeout)
|
||||
timer_delete_sync(&timer.timer);
|
||||
|
||||
/* Remove the timer from the object tracker */
|
||||
destroy_timer_on_stack(&timer.timer);
|
||||
timer_destroy_on_stack(&timer.timer);
|
||||
|
||||
timeout = expire - jiffies;
|
||||
|
||||
|
@ -850,7 +850,7 @@ static void do_init_timer(struct timer_list *timer,
|
||||
unsigned int flags,
|
||||
const char *name, struct lock_class_key *key);
|
||||
|
||||
void init_timer_on_stack_key(struct timer_list *timer,
|
||||
void timer_init_key_on_stack(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *),
|
||||
unsigned int flags,
|
||||
const char *name, struct lock_class_key *key)
|
||||
@ -858,13 +858,13 @@ void init_timer_on_stack_key(struct timer_list *timer,
|
||||
debug_object_init_on_stack(timer, &timer_debug_descr);
|
||||
do_init_timer(timer, func, flags, name, key);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(init_timer_on_stack_key);
|
||||
EXPORT_SYMBOL_GPL(timer_init_key_on_stack);
|
||||
|
||||
void destroy_timer_on_stack(struct timer_list *timer)
|
||||
void timer_destroy_on_stack(struct timer_list *timer)
|
||||
{
|
||||
debug_object_free(timer, &timer_debug_descr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(destroy_timer_on_stack);
|
||||
EXPORT_SYMBOL_GPL(timer_destroy_on_stack);
|
||||
|
||||
#else
|
||||
static inline void debug_timer_init(struct timer_list *timer) { }
|
||||
@ -904,7 +904,7 @@ static void do_init_timer(struct timer_list *timer,
|
||||
}
|
||||
|
||||
/**
|
||||
* init_timer_key - initialize a timer
|
||||
* timer_init_key - initialize a timer
|
||||
* @timer: the timer to be initialized
|
||||
* @func: timer callback function
|
||||
* @flags: timer flags
|
||||
@ -912,17 +912,17 @@ static void do_init_timer(struct timer_list *timer,
|
||||
* @key: lockdep class key of the fake lock used for tracking timer
|
||||
* sync lock dependencies
|
||||
*
|
||||
* init_timer_key() must be done to a timer prior to calling *any* of the
|
||||
* timer_init_key() must be done to a timer prior to calling *any* of the
|
||||
* other timer functions.
|
||||
*/
|
||||
void init_timer_key(struct timer_list *timer,
|
||||
void timer_init_key(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *), unsigned int flags,
|
||||
const char *name, struct lock_class_key *key)
|
||||
{
|
||||
debug_init(timer);
|
||||
do_init_timer(timer, func, flags, name, key);
|
||||
}
|
||||
EXPORT_SYMBOL(init_timer_key);
|
||||
EXPORT_SYMBOL(timer_init_key);
|
||||
|
||||
static inline void detach_timer(struct timer_list *timer, bool clear_pending)
|
||||
{
|
||||
@ -1511,7 +1511,7 @@ static int __try_to_del_timer_sync(struct timer_list *timer, bool shutdown)
|
||||
}
|
||||
|
||||
/**
|
||||
* try_to_del_timer_sync - Try to deactivate a timer
|
||||
* timer_delete_sync_try - Try to deactivate a timer
|
||||
* @timer: Timer to deactivate
|
||||
*
|
||||
* This function tries to deactivate a timer. On success the timer is not
|
||||
@ -1526,11 +1526,11 @@ static int __try_to_del_timer_sync(struct timer_list *timer, bool shutdown)
|
||||
* * %1 - The timer was pending and deactivated
|
||||
* * %-1 - The timer callback function is running on a different CPU
|
||||
*/
|
||||
int try_to_del_timer_sync(struct timer_list *timer)
|
||||
int timer_delete_sync_try(struct timer_list *timer)
|
||||
{
|
||||
return __try_to_del_timer_sync(timer, false);
|
||||
}
|
||||
EXPORT_SYMBOL(try_to_del_timer_sync);
|
||||
EXPORT_SYMBOL(timer_delete_sync_try);
|
||||
|
||||
#ifdef CONFIG_PREEMPT_RT
|
||||
static __init void timer_base_init_expiry_lock(struct timer_base *base)
|
||||
@ -1900,7 +1900,7 @@ static void timer_recalc_next_expiry(struct timer_base *base)
|
||||
unsigned long clk, next, adj;
|
||||
unsigned lvl, offset = 0;
|
||||
|
||||
next = base->clk + NEXT_TIMER_MAX_DELTA;
|
||||
next = base->clk + TIMER_NEXT_MAX_DELTA;
|
||||
clk = base->clk;
|
||||
for (lvl = 0; lvl < LVL_DEPTH; lvl++, offset += LVL_SIZE) {
|
||||
int pos = next_pending_bucket(base, offset, clk & LVL_MASK);
|
||||
@ -1963,7 +1963,7 @@ static void timer_recalc_next_expiry(struct timer_base *base)
|
||||
|
||||
WRITE_ONCE(base->next_expiry, next);
|
||||
base->next_expiry_recalc = false;
|
||||
base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
|
||||
base->timers_pending = !(next == base->clk + TIMER_NEXT_MAX_DELTA);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NO_HZ_COMMON
|
||||
@ -2015,7 +2015,7 @@ static unsigned long next_timer_interrupt(struct timer_base *base,
|
||||
* easy comparable to find out which base holds the first pending timer.
|
||||
*/
|
||||
if (!base->timers_pending)
|
||||
WRITE_ONCE(base->next_expiry, basej + NEXT_TIMER_MAX_DELTA);
|
||||
WRITE_ONCE(base->next_expiry, basej + TIMER_NEXT_MAX_DELTA);
|
||||
|
||||
return base->next_expiry;
|
||||
}
|
||||
@ -2399,7 +2399,7 @@ static inline void __run_timers(struct timer_base *base)
|
||||
* timer at this clk are that all matching timers have been
|
||||
* dequeued or no timer has been queued since
|
||||
* base::next_expiry was set to base::clk +
|
||||
* NEXT_TIMER_MAX_DELTA.
|
||||
* TIMER_NEXT_MAX_DELTA.
|
||||
*/
|
||||
WARN_ON_ONCE(!levels && !base->next_expiry_recalc
|
||||
&& base->timers_pending);
|
||||
@ -2544,7 +2544,7 @@ int timers_prepare_cpu(unsigned int cpu)
|
||||
for (b = 0; b < NR_BASES; b++) {
|
||||
base = per_cpu_ptr(&timer_bases[b], cpu);
|
||||
base->clk = jiffies;
|
||||
base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
|
||||
base->next_expiry = base->clk + TIMER_NEXT_MAX_DELTA;
|
||||
base->next_expiry_recalc = false;
|
||||
base->timers_pending = false;
|
||||
base->is_idle = false;
|
||||
@ -2599,7 +2599,7 @@ static void __init init_timer_cpu(int cpu)
|
||||
base->cpu = cpu;
|
||||
raw_spin_lock_init(&base->lock);
|
||||
base->clk = jiffies;
|
||||
base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
|
||||
base->next_expiry = base->clk + TIMER_NEXT_MAX_DELTA;
|
||||
timer_base_init_expiry_lock(base);
|
||||
}
|
||||
}
|
||||
@ -2612,7 +2612,7 @@ static void __init init_timer_cpus(void)
|
||||
init_timer_cpu(cpu);
|
||||
}
|
||||
|
||||
void __init init_timers(void)
|
||||
void __init timers_init(void)
|
||||
{
|
||||
init_timer_cpus();
|
||||
posix_cputimers_init_work();
|
||||
|
@ -686,7 +686,7 @@ EXPORT_SYMBOL_GPL(destroy_work_on_stack);
|
||||
|
||||
void destroy_delayed_work_on_stack(struct delayed_work *work)
|
||||
{
|
||||
destroy_timer_on_stack(&work->timer);
|
||||
timer_destroy_on_stack(&work->timer);
|
||||
debug_object_free(&work->work, &work_debug_descr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(destroy_delayed_work_on_stack);
|
||||
|
@ -2061,7 +2061,7 @@ static void br_multicast_enable(struct bridge_mcast_own_query *query)
|
||||
{
|
||||
query->startup_sent = 0;
|
||||
|
||||
if (try_to_del_timer_sync(&query->timer) >= 0 ||
|
||||
if (timer_delete_sync_try(&query->timer) >= 0 ||
|
||||
timer_delete(&query->timer))
|
||||
mod_timer(&query->timer, jiffies);
|
||||
}
|
||||
@ -3480,7 +3480,7 @@ static void br_ip4_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
if (mp->host_joined &&
|
||||
(timer_pending(&mp->timer) ?
|
||||
time_after(mp->timer.expires, now + max_delay) :
|
||||
try_to_del_timer_sync(&mp->timer) >= 0))
|
||||
timer_delete_sync_try(&mp->timer) >= 0))
|
||||
mod_timer(&mp->timer, now + max_delay);
|
||||
|
||||
for (pp = &mp->ports;
|
||||
@ -3488,7 +3488,7 @@ static void br_ip4_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
pp = &p->next) {
|
||||
if (timer_pending(&p->timer) ?
|
||||
time_after(p->timer.expires, now + max_delay) :
|
||||
try_to_del_timer_sync(&p->timer) >= 0 &&
|
||||
timer_delete_sync_try(&p->timer) >= 0 &&
|
||||
(brmctx->multicast_igmp_version == 2 ||
|
||||
p->filter_mode == MCAST_EXCLUDE))
|
||||
mod_timer(&p->timer, now + max_delay);
|
||||
@ -3569,7 +3569,7 @@ static int br_ip6_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
if (mp->host_joined &&
|
||||
(timer_pending(&mp->timer) ?
|
||||
time_after(mp->timer.expires, now + max_delay) :
|
||||
try_to_del_timer_sync(&mp->timer) >= 0))
|
||||
timer_delete_sync_try(&mp->timer) >= 0))
|
||||
mod_timer(&mp->timer, now + max_delay);
|
||||
|
||||
for (pp = &mp->ports;
|
||||
@ -3577,7 +3577,7 @@ static int br_ip6_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
pp = &p->next) {
|
||||
if (timer_pending(&p->timer) ?
|
||||
time_after(p->timer.expires, now + max_delay) :
|
||||
try_to_del_timer_sync(&p->timer) >= 0 &&
|
||||
timer_delete_sync_try(&p->timer) >= 0 &&
|
||||
(brmctx->multicast_mld_version == 1 ||
|
||||
p->filter_mode == MCAST_EXCLUDE))
|
||||
mod_timer(&p->timer, now + max_delay);
|
||||
@ -3649,7 +3649,7 @@ br_multicast_leave_group(struct net_bridge_mcast *brmctx,
|
||||
if (!hlist_unhashed(&p->mglist) &&
|
||||
(timer_pending(&p->timer) ?
|
||||
time_after(p->timer.expires, time) :
|
||||
try_to_del_timer_sync(&p->timer) >= 0)) {
|
||||
timer_delete_sync_try(&p->timer) >= 0)) {
|
||||
mod_timer(&p->timer, time);
|
||||
}
|
||||
|
||||
@ -3665,7 +3665,7 @@ br_multicast_leave_group(struct net_bridge_mcast *brmctx,
|
||||
if (mp->host_joined &&
|
||||
(timer_pending(&mp->timer) ?
|
||||
time_after(mp->timer.expires, time) :
|
||||
try_to_del_timer_sync(&mp->timer) >= 0)) {
|
||||
timer_delete_sync_try(&mp->timer) >= 0)) {
|
||||
mod_timer(&mp->timer, time);
|
||||
}
|
||||
|
||||
@ -3681,7 +3681,7 @@ br_multicast_leave_group(struct net_bridge_mcast *brmctx,
|
||||
if (!hlist_unhashed(&p->mglist) &&
|
||||
(timer_pending(&p->timer) ?
|
||||
time_after(p->timer.expires, time) :
|
||||
try_to_del_timer_sync(&p->timer) >= 0)) {
|
||||
timer_delete_sync_try(&p->timer) >= 0)) {
|
||||
mod_timer(&p->timer, time);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ static void ct_systimer_stop(struct ct_timer_instance *ti)
|
||||
static void ct_systimer_prepare(struct ct_timer_instance *ti)
|
||||
{
|
||||
ct_systimer_stop(ti);
|
||||
try_to_del_timer_sync(&ti->timer);
|
||||
timer_delete_sync_try(&ti->timer);
|
||||
}
|
||||
|
||||
#define ct_systimer_free ct_systimer_prepare
|
||||
|
Loading…
Reference in New Issue
Block a user