Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2007 18:17:11 +0200
From:      Maxime Henrion <mux@FreeBSD.org>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        current@freebsd.org, "Jesper B. Rosenkilde" <jbr@humppa.dk>
Subject:   Re: Suggestions on Avoiding syscall Overhead
Message-ID:  <20070423161711.GV39474@elvis.mu.org>
In-Reply-To: <462CD251.9060105@freebsd.org>
References:  <f126fae00704221639l68095de1ye7ce9ba3d921bf20@mail.gmail.com> <20070423113400.GC28587@gw.humppa.dk> <462CD251.9060105@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Kientzle wrote:
> >>We can have 3 type of pages mapped into one process's address map.
> >>1. System wide global readonly page which will help on these syscalls:
> >>  gethostname,getdomainname,uname
> >>  help on importing sysenter as syscall entry point!!
> >>
> >>2. Per process Readonly page. (change will still through standard syscall)
> >>  help on the syscalls:
> >>  getuid, geteuid, getpid,getgid, getegid, getpgrp,
> >>
> >>3. As you planed, Read+Write Page
> 
> I don't really understand this suggestion.
> 
> Do any real programs call these syscalls very often?
> If not, this is unnecessary complexity.  Making
> a syscall fast that's only called once doesn't really
> help performance.
> 
> This type of approach is sometimes suggested for systime(),
> which could have a big impact, as there are real programs
> that call systime() thousands of times per second.
> But I find it hard to believe there are programs that
> call getuid() that often.

There is indeed more and more programs calling some syscalls a
*lot*, because they are developed under Linux, and people don't
notice the overhead there since they already have this kind of
optimizations.

As a datapoint, MySQL calls gettimeofday() so much that changing
the timer used on a system can lead to a very observable performance
improvement.  Similarly, PostgreSQL calls setproctitle() a lot, and
Kris measured that this was the bottleneck when measuring scalabilty.
The PostgreSQL guys have added a new configuration option to disable
this in 8.2.x.

So, even though those optimizations don't necessarily make much
sense, more and more programs rely on those syscalls being very
cheap, so it seems like FreeBSD will be forced to implement them
too.

Cheers,
Maxime



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070423161711.GV39474>