Re: [PATCH 1/3] taskstats-fork: Add a new taskstats command to get notification on fork/clone

From: Nikanth Karthikesan
Date: Mon Aug 31 2009 - 05:09:49 EST


On Monday 31 August 2009 01:22:22 Guillaume Chazarain wrote:
> On Tue, Jul 21, 2009 at 8:24 AM, Nikanth Karthikesan<knikanth@xxxxxxx>
wrote:
> > Ah.. proc-events was the exact thing, I was looking for! Thanks.
>
> AFAICT proc-events can only be used by root, so that makes it
> unsuitable for *top.
>
> Anyway, iotop will always have to iterate over all threads to query
> their taskstats and other attributes, so the O(nr_threads) complexity
> is unavoidable.
>

If it would simply iterate over all the current threads, the complexity would
be O(nr_threads). But while iterating through all the current threads, it
checks whether it is a new thread or a known thread, so that it can calculate
the delta values. This is what I optimized by using taskstats-fork, which
could be optimized using proc-events.

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