Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442764

Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks
Date 2016-07-13 20:50 +0200
Message-ID <rUxol-6SS-7@gated-at.bofh.it> (permalink)
References <rTQt3-3Fx-3@gated-at.bofh.it> <rTQt4-3Fx-19@gated-at.bofh.it> <rUnfk-8tL-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 13, 2016 at 12:53 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Andy Lutomirski <luto@kernel.org> wrote:
>
>> This allows x86_64 kernels to enable vmapped stacks.  There are a
>> couple of interesting bits.
>
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -92,6 +92,7 @@ config X86
>>       select HAVE_ARCH_TRACEHOOK
>>       select HAVE_ARCH_TRANSPARENT_HUGEPAGE
>>       select HAVE_EBPF_JIT                    if X86_64
>> +     select HAVE_ARCH_VMAP_STACK             if X86_64
>
> So what is the performance impact?

Seems to be a very slight speedup (0.5 µs or so) on my silly benchmark
(pthread_create, pthread_join in a loop).  It should be a small
slowdown on workloads that create many threads all at once, thus
defeating the stack cache.  It should be a *large* speedup on any
workload that would trigger compaction on clone() to satisfy the
high-order allocation.

>
> Because I think we should consider enabling this feature by default on x86 - but
> the way it's selected here it will be default-off.
>
> On the plus side: the debuggability and reliability improvements are real and
> making it harder for exploits to use kernel stack overflows is a nice bonus as
> well. There's two performance effects:

Agreed.  At the very least, I want to wait until after net-next gets
pulled to flip the default to y.  I'm also a bit concerned about more
random driver issues that I haven't found yet.  I suppose we could
flip the default to y for a few -rc releases and see what, if
anything, shakes loose.

--Andy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Andy Lutomirski <luto@kernel.org> - 2016-07-11 23:00 +0200
  Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Ingo Molnar <mingo@kernel.org> - 2016-07-13 10:00 +0200
    Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Andy Lutomirski <luto@amacapital.net> - 2016-07-13 20:50 +0200
      Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Ingo Molnar <mingo@kernel.org> - 2016-07-14 10:40 +0200
        Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Andy Lutomirski <luto@amacapital.net> - 2016-07-14 19:00 +0200
          Re: [PATCH v5 14/32] x86/mm/64: Enable vmapped stacks Ingo Molnar <mingo@kernel.org> - 2016-07-14 20:50 +0200

csiph-web