From: Stephen Hemminger <shemminger@linux-foundation.org>
To: parag.warudkar@gmail.com
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sky2: Use deferrable timer for watchdog
Date: Thu, 20 Dec 2007 09:16:03 -0800 [thread overview]
Message-ID: <20071220091603.0d69b045@deepthought> (raw)
In-Reply-To: <Pine.LNX.4.64.0712182008160.3616@mini.warudkars.net>
On Tue, 18 Dec 2007 20:13:28 -0500 (EST)
Parag Warudkar <parag.warudkar@gmail.com> wrote:
>
> sky2 can use deferrable timer for watchdog - reduces wakeups from idle per
> second.
>
> Signed-off-by: Parag Warudkar <parag.warudkar@gmail.com>
>
> --- linux-2.6/drivers/net/sky2.c 2007-12-07 10:04:39.000000000 -0500
> +++ linux-2.6-work/drivers/net/sky2.c 2007-12-18 20:07:58.000000000 -0500
> @@ -4230,7 +4230,10 @@
> sky2_show_addr(dev1);
> }
>
> - setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw);
> + hw->watchdog_timer.function = sky2_watchdog;
> + hw->watchdog_timer.data = (unsigned long) hw;
> + init_timer_deferrable(&hw->watchdog_timer);
> +
> INIT_WORK(&hw->restart_work, sky2_restart);
>
> pci_set_drvdata(pdev, hw);
Does it really reduce the wakeup's or only change who gets charged by powertop?
The system is going to wakeup once a second anyway. Looks to me that if the
timer is using round_jiffies(), that setting deferrable just changes the accounting.
My interpretation of the api is:
* round_jiffies() - timer wants to wakeup but isn't precise about when so schedule
on next second when system will wake up anyway;
e.g why meetings are usually scheduled on the hour
* deferrable - timer doesn't have to really wakeup but wants to happen near
a particular time. e.g. "I'll meet you at the pub around 8pm"
Therefore doing deferrable is unnecessary for timers using round_jiffies unless system
is so good at doing timers that it is going to skip doing timer once per second.
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
next prev parent reply other threads:[~2007-12-20 17:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-19 1:13 [PATCH] sky2: Use deferrable timer for watchdog Parag Warudkar
2007-12-20 17:16 ` Stephen Hemminger [this message]
[not found] ` <823114761-1198171803-cardhu_decombobulator_blackberry.rim.net-937108990-@bxe019.bisx.prod.on.blackberry>
2007-12-20 17:51 ` Stephen Hemminger
2007-12-20 18:05 ` Parag Warudkar
2007-12-20 19:09 ` Kok, Auke
2007-12-20 19:11 ` Arjan van de Ven
2007-12-20 19:22 ` Kok, Auke
2007-12-20 19:42 ` Arjan van de Ven
2007-12-20 20:00 ` Parag Warudkar
2007-12-20 20:04 ` Arjan van de Ven
2007-12-20 20:36 ` Parag Warudkar
2007-12-20 21:08 ` Stephen Hemminger
2007-12-20 21:24 ` Kok, Auke
2007-12-20 20:17 ` Krzysztof Oledzki
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=20071220091603.0d69b045@deepthought \
--to=shemminger@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=parag.warudkar@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.