Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Global page into user processes (was: Re: Patch to cache TLS in %fp7 to avoid _lwp_getprivate syscalls)



On Tue, 17 Jan 2012 23:14:28 +0100
Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:

> May I interest you in looking at a different approach for this?
> It would be far preferable to not depend on the %fp7 register to be
> unused and instead implement either of the two approaches in
> 
> http://mail-index.netbsd.org/port-m68k/2011/11/19/msg000303.html

After reading the patch and seeing the solution about mapping a global
page into user processes, it reminds me that a possible solution to
have faster time query functions (such as gettimeofday(2)) would be to
also have a special page+structure shared and mapped readonly+noexec in
every process, such that some syscalls may be replaced by libc functions
that access that structure, which the kernel would update.  At libc
initialization, a syscall (or sysctl, ELF trick or other solution) could
be used such that the pointer to that structure is known...

Since that doesn't already exist but appears at first glance rather
simple to implement, is there a particular reason that makes this
undesirable?

Just recently, someone on the freenode #netbsd channel was complaining
of the slow gettimeofday(2) we have, which brought back this issue in
my memory.  Some of my own applications regularily update a timer
variable such that timestamp query operations be faster (either via
another thread dedicated to that effect, or at the event of a SIGALRM
signal catched in the main kqueue loop), a hack to avoid the slower
syscall path everytime.

Thanks,
-- 
Matt


Home | Main Index | Thread Index | Old Index