Re: [RFC] [PATCH] Performance of del_timer_sync

From: Andrew Morton
Date: Tue May 11 2004 - 14:14:56 EST


"Geoff Gustafson" <geoff@xxxxxxxxxxxxxxxxxx> wrote:
>
> Andrew Morton wrote:
> > Geoff Gustafson <geoff@xxxxxxxxxxxxxxxxxx> wrote:
> >>
> >> I started this patch based on profiling an enterprise database
> >> application on a 32p IA64 NUMA machine, where del_timer_sync was
> >> one of the top few functions taking CPU time in the kernel.
> >
> > Do you know where it's being called from?
>
> OK, the main sources were:
>
> sys_semtimedop() -> schedule_timeout()
>
> sys_io_getevents() -> read_events() -> clear_timeout()
>

OK, thanks. schedule_timeout()! Ow.

Ingo, why is this not sufficient?


diff -puN kernel/timer.c~a kernel/timer.c
--- 25/kernel/timer.c~a 2004-05-11 12:10:28.695557600 -0700
+++ 25-akpm/kernel/timer.c 2004-05-11 12:10:42.820410296 -0700
@@ -331,6 +331,8 @@ int del_timer_sync(struct timer_list *ti

del_again:
ret += del_timer(timer);
+ if (!ret)
+ return 0;

for_each_cpu(i) {
base = &per_cpu(tvec_bases, i);

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/