RE: [RFC] [PATCH] Performance of del_timer_sync

From: Chen, Kenneth W
Date: Tue May 11 2004 - 14:24:29 EST


>>>> Andrew Morton wrote on Tuesday, May 11, 2004 12:11 PM
> > > 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);


Hehe ... , first thing we tried :-). But has problem that if timeout
function is running while del_timer_sync() is called, it returns
without waiting.

- Ken


-
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/