diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-07-04 05:50:31 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-07 04:35:09 -0400 |
commit | 53bf837b78d155b8e1110b3c25b4d0d6391b8ff3 (patch) | |
tree | 544f2514202481290a1d67f389f26660c482e409 | |
parent | 500462a9de657f86edaa102f8ab6bff7f7e43fc2 (diff) |
timers: Remove set_timer_slack() leftovers
We now have implicit batching in the timer wheel. The slack API is no longer
used, so remove it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Chris Mason <clm@fb.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: George Spelvin <linux@sciencehorizons.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160704094342.189813118@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | block/genhd.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/jz4740_mmc.c | 2 | ||||
-rw-r--r-- | drivers/power/bq27xxx_battery.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 1 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 2 | ||||
-rw-r--r-- | include/linux/timer.h | 4 | ||||
-rw-r--r-- | kernel/time/timer.c | 19 | ||||
-rw-r--r-- | lib/random32.c | 1 |
8 files changed, 1 insertions, 38 deletions
diff --git a/block/genhd.c b/block/genhd.c index 9f42526b4d62..f06d7f3b075b 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -1523,12 +1523,7 @@ static void __disk_unblock_events(struct gendisk *disk, bool check_now) | |||
1523 | if (--ev->block) | 1523 | if (--ev->block) |
1524 | goto out_unlock; | 1524 | goto out_unlock; |
1525 | 1525 | ||
1526 | /* | ||
1527 | * Not exactly a latency critical operation, set poll timer | ||
1528 | * slack to 25% and kick event check. | ||
1529 | */ | ||
1530 | intv = disk_events_poll_jiffies(disk); | 1526 | intv = disk_events_poll_jiffies(disk); |
1531 | set_timer_slack(&ev->dwork.timer, intv / 4); | ||
1532 | if (check_now) | 1527 | if (check_now) |
1533 | queue_delayed_work(system_freezable_power_efficient_wq, | 1528 | queue_delayed_work(system_freezable_power_efficient_wq, |
1534 | &ev->dwork, 0); | 1529 | &ev->dwork, 0); |
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index 03ddf0ecf402..684087db170b 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c | |||
@@ -1068,8 +1068,6 @@ static int jz4740_mmc_probe(struct platform_device* pdev) | |||
1068 | jz4740_mmc_clock_disable(host); | 1068 | jz4740_mmc_clock_disable(host); |
1069 | setup_timer(&host->timeout_timer, jz4740_mmc_timeout, | 1069 | setup_timer(&host->timeout_timer, jz4740_mmc_timeout, |
1070 | (unsigned long)host); | 1070 | (unsigned long)host); |
1071 | /* It is not important when it times out, it just needs to timeout. */ | ||
1072 | set_timer_slack(&host->timeout_timer, HZ); | ||
1073 | 1071 | ||
1074 | host->use_dma = true; | 1072 | host->use_dma = true; |
1075 | if (host->use_dma && jz4740_mmc_acquire_dma_channels(host) != 0) | 1073 | if (host->use_dma && jz4740_mmc_acquire_dma_channels(host) != 0) |
diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c index 45f6ebf88df6..e90b3f307e0f 100644 --- a/drivers/power/bq27xxx_battery.c +++ b/drivers/power/bq27xxx_battery.c | |||
@@ -735,11 +735,8 @@ static void bq27xxx_battery_poll(struct work_struct *work) | |||
735 | 735 | ||
736 | bq27xxx_battery_update(di); | 736 | bq27xxx_battery_update(di); |
737 | 737 | ||
738 | if (poll_interval > 0) { | 738 | if (poll_interval > 0) |
739 | /* The timer does not have to be accurate. */ | ||
740 | set_timer_slack(&di->work.timer, poll_interval * HZ / 4); | ||
741 | schedule_delayed_work(&di->work, poll_interval * HZ); | 739 | schedule_delayed_work(&di->work, poll_interval * HZ); |
742 | } | ||
743 | } | 740 | } |
744 | 741 | ||
745 | /* | 742 | /* |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 0449235d4f22..1700908b84ef 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -500,7 +500,6 @@ static int ohci_init (struct ohci_hcd *ohci) | |||
500 | 500 | ||
501 | setup_timer(&ohci->io_watchdog, io_watchdog_func, | 501 | setup_timer(&ohci->io_watchdog, io_watchdog_func, |
502 | (unsigned long) ohci); | 502 | (unsigned long) ohci); |
503 | set_timer_slack(&ohci->io_watchdog, msecs_to_jiffies(20)); | ||
504 | 503 | ||
505 | ohci->hcca = dma_alloc_coherent (hcd->self.controller, | 504 | ohci->hcca = dma_alloc_coherent (hcd->self.controller, |
506 | sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL); | 505 | sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index f2f9518c53ab..a986fe763d87 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -490,8 +490,6 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) | |||
490 | xhci->comp_mode_recovery_timer.expires = jiffies + | 490 | xhci->comp_mode_recovery_timer.expires = jiffies + |
491 | msecs_to_jiffies(COMP_MODE_RCVRY_MSECS); | 491 | msecs_to_jiffies(COMP_MODE_RCVRY_MSECS); |
492 | 492 | ||
493 | set_timer_slack(&xhci->comp_mode_recovery_timer, | ||
494 | msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); | ||
495 | add_timer(&xhci->comp_mode_recovery_timer); | 493 | add_timer(&xhci->comp_mode_recovery_timer); |
496 | xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, | 494 | xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, |
497 | "Compliance mode recovery timer initialized"); | 495 | "Compliance mode recovery timer initialized"); |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 5869ab9848fe..4419506b564e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -19,7 +19,6 @@ struct timer_list { | |||
19 | void (*function)(unsigned long); | 19 | void (*function)(unsigned long); |
20 | unsigned long data; | 20 | unsigned long data; |
21 | u32 flags; | 21 | u32 flags; |
22 | int slack; | ||
23 | 22 | ||
24 | #ifdef CONFIG_TIMER_STATS | 23 | #ifdef CONFIG_TIMER_STATS |
25 | int start_pid; | 24 | int start_pid; |
@@ -73,7 +72,6 @@ struct timer_list { | |||
73 | .expires = (_expires), \ | 72 | .expires = (_expires), \ |
74 | .data = (_data), \ | 73 | .data = (_data), \ |
75 | .flags = (_flags), \ | 74 | .flags = (_flags), \ |
76 | .slack = -1, \ | ||
77 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 75 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
78 | __FILE__ ":" __stringify(__LINE__)) \ | 76 | __FILE__ ":" __stringify(__LINE__)) \ |
79 | } | 77 | } |
@@ -193,8 +191,6 @@ extern int del_timer(struct timer_list * timer); | |||
193 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | 191 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
194 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); | 192 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); |
195 | 193 | ||
196 | extern void set_timer_slack(struct timer_list *time, int slack_hz); | ||
197 | |||
198 | /* | 194 | /* |
199 | * The jiffies value which is added to now, when there is no timer | 195 | * The jiffies value which is added to now, when there is no timer |
200 | * in the timer wheel: | 196 | * in the timer wheel: |
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 86e95b72665d..a83e23d0bc25 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c | |||
@@ -447,24 +447,6 @@ unsigned long round_jiffies_up_relative(unsigned long j) | |||
447 | } | 447 | } |
448 | EXPORT_SYMBOL_GPL(round_jiffies_up_relative); | 448 | EXPORT_SYMBOL_GPL(round_jiffies_up_relative); |
449 | 449 | ||
450 | /** | ||
451 | * set_timer_slack - set the allowed slack for a timer | ||
452 | * @timer: the timer to be modified | ||
453 | * @slack_hz: the amount of time (in jiffies) allowed for rounding | ||
454 | * | ||
455 | * Set the amount of time, in jiffies, that a certain timer has | ||
456 | * in terms of slack. By setting this value, the timer subsystem | ||
457 | * will schedule the actual timer somewhere between | ||
458 | * the time mod_timer() asks for, and that time plus the slack. | ||
459 | * | ||
460 | * By setting the slack to -1, a percentage of the delay is used | ||
461 | * instead. | ||
462 | */ | ||
463 | void set_timer_slack(struct timer_list *timer, int slack_hz) | ||
464 | { | ||
465 | timer->slack = slack_hz; | ||
466 | } | ||
467 | EXPORT_SYMBOL_GPL(set_timer_slack); | ||
468 | 450 | ||
469 | static inline unsigned int timer_get_idx(struct timer_list *timer) | 451 | static inline unsigned int timer_get_idx(struct timer_list *timer) |
470 | { | 452 | { |
@@ -775,7 +757,6 @@ static void do_init_timer(struct timer_list *timer, unsigned int flags, | |||
775 | { | 757 | { |
776 | timer->entry.pprev = NULL; | 758 | timer->entry.pprev = NULL; |
777 | timer->flags = flags | raw_smp_processor_id(); | 759 | timer->flags = flags | raw_smp_processor_id(); |
778 | timer->slack = -1; | ||
779 | #ifdef CONFIG_TIMER_STATS | 760 | #ifdef CONFIG_TIMER_STATS |
780 | timer->start_site = NULL; | 761 | timer->start_site = NULL; |
781 | timer->start_pid = -1; | 762 | timer->start_pid = -1; |
diff --git a/lib/random32.c b/lib/random32.c index 510d1ce7d4d2..69ed593aab07 100644 --- a/lib/random32.c +++ b/lib/random32.c | |||
@@ -233,7 +233,6 @@ static void __prandom_timer(unsigned long dontcare) | |||
233 | 233 | ||
234 | static void __init __prandom_start_seed_timer(void) | 234 | static void __init __prandom_start_seed_timer(void) |
235 | { | 235 | { |
236 | set_timer_slack(&seed_timer, HZ); | ||
237 | seed_timer.expires = jiffies + msecs_to_jiffies(40 * MSEC_PER_SEC); | 236 | seed_timer.expires = jiffies + msecs_to_jiffies(40 * MSEC_PER_SEC); |
238 | add_timer(&seed_timer); | 237 | add_timer(&seed_timer); |
239 | } | 238 | } |