diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-18 06:23:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-18 13:26:33 -0500 |
commit | 74019224ac34b044b44a31dd89a54e3477db4896 (patch) | |
tree | bf7b04319c0c4329eb6cef0788737c14d2fa9030 /drivers/infiniband | |
parent | 5955c7a2cfb6a35429adea5dc480002b15ca8cfc (diff) |
timers: add mod_timer_pending()
Impact: new timer API
Based on an idea from Martin Josefsson with the help of
Patrick McHardy and Stephen Hemminger:
introduce the mod_timer_pending() API which is a mod_timer()
offspring that is an invariant on already removed timers.
(regular mod_timer() re-activates non-pending timers.)
This is useful for the networking code in that it can
allow unserialized mod_timer_pending() timer-forwarding
calls, but a single del_timer*() will stop the timer
from being reactivated again.
Also while at it:
- optimize the regular mod_timer() path some more, the
timer-stat and a debug check was needlessly duplicated
in __mod_timer().
- make the exports come straight after the function, as
most other exports in timer.c already did.
- eliminate __mod_timer() as an external API, change the
users to mod_timer().
The regular mod_timer() code path is not impacted
significantly, due to inlining optimizations and due to
the simplifications.
Based-on-patch-from: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_driver.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 69c0ce321b4e..cb9daa6ac029 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -2715,7 +2715,7 @@ static void ipath_hol_signal_up(struct ipath_devdata *dd) | |||
2715 | * to prevent HoL blocking, then start the HoL timer that | 2715 | * to prevent HoL blocking, then start the HoL timer that |
2716 | * periodically continues, then stop procs, so they can detect | 2716 | * periodically continues, then stop procs, so they can detect |
2717 | * link down if they want, and do something about it. | 2717 | * link down if they want, and do something about it. |
2718 | * Timer may already be running, so use __mod_timer, not add_timer. | 2718 | * Timer may already be running, so use mod_timer, not add_timer. |
2719 | */ | 2719 | */ |
2720 | void ipath_hol_down(struct ipath_devdata *dd) | 2720 | void ipath_hol_down(struct ipath_devdata *dd) |
2721 | { | 2721 | { |
@@ -2724,7 +2724,7 @@ void ipath_hol_down(struct ipath_devdata *dd) | |||
2724 | dd->ipath_hol_next = IPATH_HOL_DOWNCONT; | 2724 | dd->ipath_hol_next = IPATH_HOL_DOWNCONT; |
2725 | dd->ipath_hol_timer.expires = jiffies + | 2725 | dd->ipath_hol_timer.expires = jiffies + |
2726 | msecs_to_jiffies(ipath_hol_timeout_ms); | 2726 | msecs_to_jiffies(ipath_hol_timeout_ms); |
2727 | __mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires); | 2727 | mod_timer(&dd->ipath_hol_timer, dd->ipath_hol_timer.expires); |
2728 | } | 2728 | } |
2729 | 2729 | ||
2730 | /* | 2730 | /* |
@@ -2763,7 +2763,7 @@ void ipath_hol_event(unsigned long opaque) | |||
2763 | else { | 2763 | else { |
2764 | dd->ipath_hol_timer.expires = jiffies + | 2764 | dd->ipath_hol_timer.expires = jiffies + |
2765 | msecs_to_jiffies(ipath_hol_timeout_ms); | 2765 | msecs_to_jiffies(ipath_hol_timeout_ms); |
2766 | __mod_timer(&dd->ipath_hol_timer, | 2766 | mod_timer(&dd->ipath_hol_timer, |
2767 | dd->ipath_hol_timer.expires); | 2767 | dd->ipath_hol_timer.expires); |
2768 | } | 2768 | } |
2769 | } | 2769 | } |