[PATCH] Use uname not sysctl to get the kernel revision
Albert Cahalan
acahalan@gmail.com
Thu Jul 13 17:06:00 GMT 2006
On 7/13/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
> "Albert Cahalan" <acahalan@gmail.com> writes:
> > Matching keywords, as is needed for /proc/*/status,
> > is also horribly slow. I ended up using gperf to make
> > a perfect hash table, then gcc's computed goto for
> > jumping to the code, and it still wasn't cheap to do.
> > (while /sys lacks this, the extra open-read-close is
> > certain to be far worse)
>
> I agree matching keywords and such seems slow.
>
> If the only overhead comes from open-read-close we can
> come up with a sys_readfile that doesn't need to actually
> open the file for one shot cases.
A sys_readfile would be great. It probably should
work like readlink. Supplying a struct stat without
a race condition would be good too.
Note that /sys will still be needlessly slow because
of the one-item-per-file idea. One of the few good
things about /proc is that you can get a whole
struct full of data all at once.
Fixing one bottleneck just leads to the next. It's best
to fix all the anti-performance stupidity at once.
More information about the Libc-alpha
mailing list