Skip to content

Commit 177ec0a

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
timers: Remove the deprecated mod_timer_pinned() API
We switched all users to initialize the timers as pinned and call mod_timer(). Remove the now unused timer API function. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: Chris Mason <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: George Spelvin <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Len Brown <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent f3438bc commit 177ec0a

File tree

2 files changed

+5
-37
lines changed

2 files changed

+5
-37
lines changed

include/linux/timer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,9 @@ extern void add_timer_on(struct timer_list *timer, int cpu);
190190
extern int del_timer(struct timer_list * timer);
191191
extern int mod_timer(struct timer_list *timer, unsigned long expires);
192192
extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
193-
extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);
194193

195194
extern void set_timer_slack(struct timer_list *time, int slack_hz);
196195

197-
#define MOD_TIMER_NOT_PINNED 0
198-
#define MOD_TIMER_PINNED 1
199196
/*
200197
* The jiffies value which is added to now, when there is no timer
201198
* in the timer wheel:

kernel/time/timer.c

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,7 @@ static struct tvec_base *lock_timer_base(struct timer_list *timer,
764764
}
765765

766766
static inline int
767-
__mod_timer(struct timer_list *timer, unsigned long expires,
768-
bool pending_only, int pinned)
767+
__mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only)
769768
{
770769
struct tvec_base *base, *new_base;
771770
unsigned long flags;
@@ -782,7 +781,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires,
782781

783782
debug_activate(timer, expires);
784783

785-
new_base = get_target_base(base, pinned || timer->flags & TIMER_PINNED);
784+
new_base = get_target_base(base, timer->flags & TIMER_PINNED);
786785

787786
if (base != new_base) {
788787
/*
@@ -825,7 +824,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires,
825824
*/
826825
int mod_timer_pending(struct timer_list *timer, unsigned long expires)
827826
{
828-
return __mod_timer(timer, expires, true, MOD_TIMER_NOT_PINNED);
827+
return __mod_timer(timer, expires, true);
829828
}
830829
EXPORT_SYMBOL(mod_timer_pending);
831830

@@ -900,38 +899,10 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
900899
if (timer_pending(timer) && timer->expires == expires)
901900
return 1;
902901

903-
return __mod_timer(timer, expires, false, MOD_TIMER_NOT_PINNED);
902+
return __mod_timer(timer, expires, false);
904903
}
905904
EXPORT_SYMBOL(mod_timer);
906905

907-
/**
908-
* mod_timer_pinned - modify a timer's timeout
909-
* @timer: the timer to be modified
910-
* @expires: new timeout in jiffies
911-
*
912-
* mod_timer_pinned() is a way to update the expire field of an
913-
* active timer (if the timer is inactive it will be activated)
914-
* and to ensure that the timer is scheduled on the current CPU.
915-
*
916-
* Note that this does not prevent the timer from being migrated
917-
* when the current CPU goes offline. If this is a problem for
918-
* you, use CPU-hotplug notifiers to handle it correctly, for
919-
* example, cancelling the timer when the corresponding CPU goes
920-
* offline.
921-
*
922-
* mod_timer_pinned(timer, expires) is equivalent to:
923-
*
924-
* del_timer(timer); timer->expires = expires; add_timer(timer);
925-
*/
926-
int mod_timer_pinned(struct timer_list *timer, unsigned long expires)
927-
{
928-
if (timer->expires == expires && timer_pending(timer))
929-
return 1;
930-
931-
return __mod_timer(timer, expires, false, MOD_TIMER_PINNED);
932-
}
933-
EXPORT_SYMBOL(mod_timer_pinned);
934-
935906
/**
936907
* add_timer - start a timer
937908
* @timer: the timer to be added
@@ -1512,7 +1483,7 @@ signed long __sched schedule_timeout(signed long timeout)
15121483
expire = timeout + jiffies;
15131484

15141485
setup_timer_on_stack(&timer, process_timeout, (unsigned long)current);
1515-
__mod_timer(&timer, expire, false, MOD_TIMER_NOT_PINNED);
1486+
__mod_timer(&timer, expire, false);
15161487
schedule();
15171488
del_singleshot_timer_sync(&timer);
15181489

0 commit comments

Comments
 (0)