vDSO preliminary implementation
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Sep 14 08:44:28 EST 2004
On Tue, 2004-09-14 at 03:09, Linas Vepstas wrote:
> On Sat, Sep 11, 2004 at 10:43:38AM +1000, Benjamin Herrenschmidt was heard to remark:
> > > >
> > > > Here's a first shot at implementing a vDSO for ppc32/ppc64. This is definitely
> > >
> > > What's vDSO ? Google was amazingly unhelpful in figuring this out.
> >
> > virtual .so, that is a library mapped by the kernel in userspace
>
> Let me re-phrase that: what's it good for? Is this a mechanism for
> sharing the text segment of a library between all users?
No, not at all, it's used for the kernel to provide some specific
functions to userland, like the signal trampoline (moved out of the
stack), or a userland implementation of gettimeofday, along with things
that can optimized per-cpu (like memcpy) without the overhead of a
syscall.
> Ye olde AIX had this feature; I've never thought about whether Linux
> does this or not; shared libs were loaded so that the text segment
> of a library appeared only once in 'real' memory, and was thus shared
> by the various apps. I'm not sure, I think in AIX even the "ptes" were
> shared too: the text was always loaded into the same segment (segment 0
> iirc), so you wouldn't have tlb misses on things like libc.
>
> I've never thought about how Linux loads libraries, so excuse me on this
> newbie-sounding question. How does Linux load .so's today? Is there
> one copy per process, or are they shared?
AIX does segment sharing, which goes further. Linux doesn't share at the
low MMU level like AIX does, but the text is definitely shared (unless
something triggers a copy-on-write).
Ben.
More information about the Linuxppc64-dev
mailing list