netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Daniel Drake <dsd@gentoo.org>
Cc: netdev@vger.kernel.org, aabdulla@nvidia.com
Subject: Re: [PATCH] forcedeth: Use round_jiffies for stats timer
Date: Wed, 26 Mar 2008 00:35:36 -0400	[thread overview]
Message-ID: <47E9D298.8030609@pobox.com> (raw)
In-Reply-To: <20080318110718.A0AFE9D4143@zog.reactivated.net>

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



      reply	other threads:[~2008-03-26  4:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 11:07 [PATCH] forcedeth: Use round_jiffies for stats timer Daniel Drake
2008-03-26  4:35 ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E9D298.8030609@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=aabdulla@nvidia.com \
    --cc=dsd@gentoo.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).