Re: [PATCH] Use uname not sysctl to get the kernel revision
From: Albert Cahalan
Date: Thu Jul 13 2006 - 13:04:44 EST
On 7/13/06, Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
"Albert Cahalan" <acahalan@xxxxxxxxx> 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.
-
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/