netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] forcedeth: Use round_jiffies for stats timer
@ 2008-03-18 11:07 Daniel Drake
  2008-03-26  4:35 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2008-03-18 11:07 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, aabdulla

This timer doesn't need to run at precise times, so round it to a whole
second to decrease wakeups.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
---
 drivers/net/forcedeth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 801b4d9..3f0d242 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3792,7 +3792,8 @@ static void nv_do_stats_poll(unsigned long data)
 	nv_get_hw_stats(dev);
 
 	if (!np->in_shutdown)
-		mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
+		mod_timer(&np->stats_poll,
+			round_jiffies(jiffies + STATS_INTERVAL));
 }
 
 static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
@@ -4996,7 +4997,8 @@ static int nv_open(struct net_device *dev)
 
 	/* start statistics timer */
 	if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2))
-		mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
+		mod_timer(&np->stats_poll,
+			round_jiffies(jiffies + STATS_INTERVAL));
 
 	spin_unlock_irq(&np->lock);
 
-- 
1.5.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] forcedeth: Use round_jiffies for stats timer
  2008-03-18 11:07 [PATCH] forcedeth: Use round_jiffies for stats timer Daniel Drake
@ 2008-03-26  4:35 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-03-26  4:35 UTC (permalink / raw)
  To: Daniel Drake; +Cc: netdev, aabdulla

Daniel Drake wrote:
> This timer doesn't need to run at precise times, so round it to a whole
> second to decrease wakeups.
> 
> Signed-off-by: Daniel Drake <dsd@gentoo.org>
> ---
>  drivers/net/forcedeth.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> index 801b4d9..3f0d242 100644
> --- a/drivers/net/forcedeth.c
> +++ b/drivers/net/forcedeth.c
> @@ -3792,7 +3792,8 @@ static void nv_do_stats_poll(unsigned long data)
>  	nv_get_hw_stats(dev);
>  
>  	if (!np->in_shutdown)
> -		mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
> +		mod_timer(&np->stats_poll,
> +			round_jiffies(jiffies + STATS_INTERVAL));
>  }
>  
>  static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
> @@ -4996,7 +4997,8 @@ static int nv_open(struct net_device *dev)
>  
>  	/* start statistics timer */
>  	if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2))
> -		mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
> +		mod_timer(&np->stats_poll,
> +			round_jiffies(jiffies + STATS_INTERVAL));
>  
>  	spin_unlock_irq(&np->lock);

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-26  4:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18 11:07 [PATCH] forcedeth: Use round_jiffies for stats timer Daniel Drake
2008-03-26  4:35 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).