[...]
>
> 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/