Re: [patch] procfs/procps threading performance speedup, 2.5.62

From: Nikita Danilov (Nikita@Namesys.COM)
Date: Thu Feb 20 2003 - 12:00:01 EST


Ingo Molnar writes:
>

[...]

>
> to fix this overhead i've introduced a 'lookup cursor' cookie, which is
> cached in filp->private_data, across readdir() [getdents64()] calls. If
> the cursor matches then we skip all the overhead of skipping threads. If
> the cursor is not available then we fall back to the old-style skipping
> algorithm.

Shouldn't filp->private_data be cleared on lseek? It looks like lookup
cursor is never cleared once set and so readdir will always go forward
independently of ->f_pos updates. Note that glibc implementation of
readdir() (on the top of getdents64()) does call lseek on the
directory. So does seekdir(3).

>
> 2) procps is forced to parse every thread in /proc to build up accurate
> 'process CPU usage' counters. The parsing and accessing of every

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



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:29 EST