* mod_timer improvement
@ 2003-10-02 16:54 Steve Modica
2003-10-02 17:15 ` Steve Modica
0 siblings, 1 reply; 4+ messages in thread
From: Steve Modica @ 2003-10-02 16:54 UTC (permalink / raw)
To: netdev
This improves mod_timer scaling quite drastically. It's already in the 2.6 kernel. I've been testing with 8 cpus, 8 threads and 8 cards and mod_timer ends up taking up more time than tg_poll without this change.
*** /hosts/bonnie.engr.sgi.com//proj/sgilinux/lbs/isms/linux/linux/kernel/timer.c 2003/08/11 20:16:19 1.23
--- /hosts/bonnie.engr.sgi.com//proj/sgilinux/lbs/isms/linux/linux/kernel/timer.c 2003/10/01 21:09:20 1.24 ***************
*** 207,212 ****
--- 207,220 ----
int ret;
unsigned long flags;
+ /*
+ * This is a common optimization triggered by the
+ * networking code - if the timer is re-modified
+ * to be the same thing then just return:
+ */
+ if (timer->expires == expires && timer_pending(timer))
+ return 1;
+
spin_lock_irqsave(&timerlist_lock, flags);
timer->expires = expires;
ret = detach_timer(timer);
--
Steve Modica
work: 651-683-3224
mobile: 651-261-3201
MTS-Technical Lead
"Give a man a fish, and he will eat for a day, hit him with a fish and
he leaves you alone" - me
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mod_timer improvement
2003-10-02 16:54 Steve Modica
@ 2003-10-02 17:15 ` Steve Modica
2003-10-03 6:40 ` David S. Miller
0 siblings, 1 reply; 4+ messages in thread
From: Steve Modica @ 2003-10-02 17:15 UTC (permalink / raw)
To: netdev
D'OH! Sorry about the formatting. I think this is better:
@@ -207,6 +207,14 @@
int ret;
unsigned long flags;
+ /*
+ * This is a common optimization triggered by the
+ * networking code - if the timer is re-modified
+ * to be the same thing then just return:
+ */
+ if (timer->expires == expires && timer_pending(timer))
+ return 1;
+
spin_lock_irqsave(&timerlist_lock, flags);
timer->expires = expires;
ret = detach_timer(timer);
--
Steve Modica
work: 651-683-3224
mobile: 651-261-3201
MTS-Technical Lead
"Give a man a fish, and he will eat for a day, hit him with a fish and
he leaves you alone" - me
^ permalink raw reply [flat|nested] 4+ messages in thread
* mod_timer improvement
@ 2003-10-02 18:20 Steve Modica
0 siblings, 0 replies; 4+ messages in thread
From: Steve Modica @ 2003-10-02 18:20 UTC (permalink / raw)
To: netdev
Sorry about the screwed up formatting! I'm kinda new at this :)
*** linux/linux/kernel/timer.c 2003/08/11 20:16:19 1.23
--- linux/linux/kernel/timer.c 2003/10/01 21:09:20 1.24
*************** int mod_timer(struct timer_list *timer,
*** 207,212 ****
--- 207,220 ----
int ret;
unsigned long flags;
+ /*
+ * This is a common optimization triggered by the
+ * networking code - if the timer is re-modified
+ * to be the same thing then just return:
+ */
+ if (timer->expires == expires && timer_pending(timer))
+ return 1;
+
spin_lock_irqsave(&timerlist_lock, flags);
timer->expires = expires;
ret = detach_timer(timer);
--
Steve Modica
work: 651-683-3224
mobile: 651-261-3201
MTS-Technical Lead
"Give a man a fish, and he will eat for a day, hit him with a fish and
he leaves you alone" - me
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mod_timer improvement
2003-10-02 17:15 ` Steve Modica
@ 2003-10-03 6:40 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-10-03 6:40 UTC (permalink / raw)
To: Steve Modica; +Cc: netdev
On Thu, 02 Oct 2003 12:15:14 -0500
Steve Modica <modica@sgi.com> wrote:
> D'OH! Sorry about the formatting. I think this is better:
Probably the networking development list isn't the place
to post patches that modify generic code such as the timer
stuff you are modifying here.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-03 6:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-02 18:20 mod_timer improvement Steve Modica
-- strict thread matches above, loose matches on Subject: below --
2003-10-02 16:54 Steve Modica
2003-10-02 17:15 ` Steve Modica
2003-10-03 6:40 ` David S. Miller
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).