Messages in this thread | | | Date | Thu, 13 Jul 2006 13:06:32 -0400 | From | "Albert Cahalan" <> | Subject | Re: [PATCH] Use uname not sysctl to get the kernel revision |
| |
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. - 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/
| |