Messages in this thread | | | From | Nikanth Karthikesan <> | Subject | Re: [PATCH 1/3] taskstats-fork: Add a new taskstats command to get notification on fork/clone | Date | Mon, 31 Aug 2009 14:41:28 +0530 |
| |
On Monday 31 August 2009 01:22:22 Guillaume Chazarain wrote: > On Tue, Jul 21, 2009 at 8:24 AM, Nikanth Karthikesan<knikanth@suse.de> 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
| |