From: "H. Peter Anvin" <hpa@zytor.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
X86 ML <x86@kernel.org>, Russ Cox <rsc@golang.org>,
Ian Taylor <iant@golang.org>
Subject: Re: vdso feature requests from the Go people
Date: Fri, 13 Jun 2014 09:03:02 -0700 [thread overview]
Message-ID: <539B20B6.2070705@zytor.com> (raw)
In-Reply-To: <CALCETrVya47r1j6YUHT4_=gb6Pb5qB4sGE5sfwmxievcjdTTUw@mail.gmail.com>
On 06/13/2014 08:34 AM, Andy Lutomirski wrote:
>
> I'm only aware of two implementations that work like that: glibc and
> musl. AFAIK neither one even tries to use the vdso when statically
> linked. IIRC, Bionic doesn't support the vdso at all, and Go has the
> present issue.
>
I would expect uClibc to behave similarly. Bionic does, indeed, not
support the vdso, but that is not for the lack of a linker but is really
a shortcoming in Bionic.
> And ELF parsing is a giant mess. Currently the vdso doesn't use
> DT_GNU_HASH (easy to fix) but no one can safely rely on DT_GNU_HASH
> being there, and DT_GNU_HASH isn't actually easier to parse.
Right... and the vdso is small enough that the performance doesn't
matter. However, we probably *ought* to publish DT_GNU_HASH data.
>>> 2. Go uses a segmented stack, and the vdso is quite unfriendly for
>>> segmented stack. If we can get compiler support, is there a
>>> reasonable way that we could advertise the maximum stack usage of each
>>> vdso entry point?
>>
>> I suspect an easier way to do that would just be to define a maximum
>> stack usage for *any* vdso entry point, and then enable the gcc stack
>> depth warning (perhaps even with Werror)... we can do this now.
>
> I can imagine this causing lots of pain when gcc 4.11 comes out with
> some issue that blows up the stack usage. Or when akpm compiles on
> Fedora Core 6 using some ancient toolchain that spills every local
> variable three or four times and assigns every possible inline
> function its own non-overlapping stack range.
>
> My copy of gcc supports -fstack-usage, which seems like an easyish way
> to obtain the information. I'm not entirely sure whether
> -fstack-usage refers to the whole call tree or just to the specific
> function.
There are issues either way. However, most vdso code doesn't use much
stack at all, and it seems reasonable to put a (conservative) cap on it
as a matter of policy.
-hpa
next prev parent reply other threads:[~2014-06-13 16:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 4:36 vdso feature requests from the Go people Andy Lutomirski
2014-06-13 4:46 ` Andy Lutomirski
2014-06-13 5:15 ` H. Peter Anvin
2014-06-13 5:23 ` Andy Lutomirski
2014-06-13 5:39 ` H. Peter Anvin
2014-06-15 9:39 ` Stijn Volckaert
2014-06-13 5:39 ` H. Peter Anvin
2014-06-13 15:34 ` Andy Lutomirski
2014-06-13 16:03 ` H. Peter Anvin [this message]
2014-06-15 10:15 ` Stijn Volckaert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=539B20B6.2070705@zytor.com \
--to=hpa@zytor.com \
--cc=iant@golang.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=rsc@golang.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox