Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2007 06:15:58 -0700
From:      Suleiman Souhlal <ssouhlal@freebsd.org>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        current@freebsd.org
Subject:   Re: Suggestions on Avoiding syscall Overhead
Message-ID:  <EF73A6A3-0FD8-46FC-BB4D-7E0F87D71D1B@freebsd.org>
In-Reply-To: <20070426102420.GA819@turion.vk2pj.dyndns.org>
References:  <f126fae00704221639l68095de1ye7ce9ba3d921bf20@mail.gmail.com> <20070423113400.GC28587@gw.humppa.dk> <2018ADA6-11D5-48D1-98BD-4397A60E14AF@FreeBSD.org> <20070426102420.GA819@turion.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Apr 26, 2007, at 3:24 AM, Peter Jeremy wrote:

> On 2007-Apr-25 01:03:19 -0700, Suleiman Souhlal  
> <ssouhlal@freebsd.org> wrote:
>> IMHO, the main usage of the global readonly page is (apart from
>> faster gettimeofday and similar) is that you can put the syscall
>> entry function in it, and have the kernel choose at boot the most
>> efficient method (INT 0x80 or SYSENTER/SYSCALL) based on what the CPU
>> supports, while still having binaries that run everywhere.
>
> That's a nice idea.  The only downside I see is that it means the
> page would need to be executable.  I would prefer not to have
> data areas executable - even if they are read-only.

Why not?

> I think that FreeBSD should make more use of CPU-specific coding to
> enhance performance.  Maybe even something along the lines of Solaris
> where linking to libc implicitly links to a CPU-specific .so if it
> exists.

I have a proof of concept patch that enables the kernel to patch  
itself at boot to use certain instructions in certain selected places  
based on the CPUID bits: http://people.freebsd.org/~ssouhlal/testing/ 
bootpatch-20060527.diff .
The patch just  prefetches the next element in a list when using  
TAILQ/STAILQ/etc_FOREACH() (which is pretty useless), using the  
PREFETCHNTA instruction if the CPU supports SSE2 and PREFETCH  
otherwise, but it could also be used for potentially more useful  
things like using *FENCE instructions in atomic_store/load_rel/acq_* 
() when the CPU supports them, instead of LOCK, on i386..

-- Suleiman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EF73A6A3-0FD8-46FC-BB4D-7E0F87D71D1B>