Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1430097
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) |
| Date | 2016-06-23 21:40 +0200 |
| Message-ID | <rNiDM-6cT-19@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <rMlaF-Mm-5@gated-at.bofh.it> <rN1CW-2Rr-9@gated-at.bofh.it> <rN5ZU-5W6-25@gated-at.bofh.it> <rNdXs-2Tn-35@gated-at.bofh.it> <rNikp-64A-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 23, 2016 at 12:11 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> Didn't we talk about using SLAB_DESTROY_BY_RCU for task_struct before?
> If that is possible, a reuse in per-cpu cache is equally possible.
>
> All we really want to guarantee is that the memory remains a
> task_struct, it need not remain the same task, right?
No, we can't do SLAB_DESTROY_BY_RCU for the task_struct itself,
because the RCU list traversal does expect that the thread and task
lists are stable even if it walks into a "stale" struct task_struct.
If we re-use the task-struct before the RCU grace period is over, then
the list walker might end up walking into the wrong thread group
(bad!) or seeing tasks twice on the task list (also bad, although
perhaps not _as_ bad).
The _other_ fields might be ok, but updaing the very list fields that
we walk with RCU is a no-no.
Basically, SLAB_DESTROY_BY_RCU is fine only for things where the RCU
field use is idempotent. So for things where the RCU walker only looks
at entries that don't matter semantically, or where it does things
like "lock/unlock" on a lock that is still valid.
It's actually fairly rare that we can use SLAB_DESTROY_BY_RCU. We have
that sighand thing, and there's a couple of networking uses for the
request_sock and socket slabs. And I sincerely hope the socket slab
RCU lists are safe, because it's dangerous.
Linus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 02/13] x86/cpa: In populate_pgd, don't set the pgd entry until it's populated Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 03/13] x86/mm: Remove kernel_unmap_pages_in_pgd() and efi_cleanup_page_tables() Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
Re: [PATCH v3 03/13] x86/mm: Remove kernel_unmap_pages_in_pgd() and efi_cleanup_page_tables() Matt Fleming <matt@codeblueprint.co.uk> - 2016-06-21 12:20 +0200
[PATCH v3 11/13] x86/dumpstack/64: Handle faults when printing the "Stack:" part of an OOPS Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 06/13] fork: Add generic vmalloced stack support Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Jann Horn <jannh@google.com> - 2016-06-21 12:10 +0200
Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Andy Lutomirski <luto@amacapital.net> - 2016-06-21 19:10 +0200
Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Kees Cook <keescook@chromium.org> - 2016-06-21 19:20 +0200
Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Andy Lutomirski <luto@amacapital.net> - 2016-06-21 19:40 +0200
Re: [kernel-hardening] Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Rik van Riel <riel@redhat.com> - 2016-06-21 20:50 +0200
Re: [kernel-hardening] Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Andy Lutomirski <luto@amacapital.net> - 2016-06-21 21:50 +0200
Re: [kernel-hardening] Re: [PATCH v3 06/13] fork: Add generic vmalloced stack support Arnd Bergmann <arnd@arndb.de> - 2016-06-21 22:00 +0200
[PATCH v3 04/13] mm: Track NR_KERNEL_STACK in KiB instead of number of stacks Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
Re: [PATCH v3 04/13] mm: Track NR_KERNEL_STACK in KiB instead of number of stacks Michal Hocko <mhocko@kernel.org> - 2016-06-22 10:50 +0200
[PATCH v3 07/13] x86/die: Don't try to recover from an OOPS on a non-default stack Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 08/13] x86/dumpstack: When OOPSing, rewind the stack before do_exit Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 01/13] x86/mm/hotplug: Don't remove PGD entries in remove_pagetable() Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 10/13] x86/dumpstack: Try harder to get a call trace on stack overflow Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
[PATCH v3 09/13] x86/dumpstack: When dumping stack bytes due to OOPS, start with regs->sp Andy Lutomirski <luto@kernel.org> - 2016-06-21 01:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-21 06:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-21 18:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-21 19:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-21 19:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Kees Cook <keescook@chromium.org> - 2016-06-21 20:20 +0200
Re: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Rik van Riel <riel@redhat.com> - 2016-06-21 20:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-23 03:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 08:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-23 16:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 18:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-23 18:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-23 19:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-23 19:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 19:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 20:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Kees Cook <keescook@chromium.org> - 2016-06-23 20:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-23 20:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 20:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-23 21:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 21:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 08:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Brian Gerst <brgerst@gmail.com> - 2016-06-24 14:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 19:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 19:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-24 19:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 20:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-24 20:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 20:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 20:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-24 23:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-24 23:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 23:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-24 23:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-24 23:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-24 23:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-25 04:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-26 01:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-26 01:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-26 03:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-24 23:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-23 21:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-23 21:00 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Michal Hocko <mhocko@kernel.org> - 2016-06-24 16:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Michal Hocko <mhocko@kernel.org> - 2016-06-24 17:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Oleg Nesterov <oleg@redhat.com> - 2016-06-24 22:30 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Michal Hocko <mhocko@kernel.org> - 2016-06-27 12:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-23 21:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Peter Zijlstra <peterz@infradead.org> - 2016-06-23 21:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Arnd Bergmann <arnd@arndb.de> - 2016-06-21 11:40 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Kees Cook <keescook@chromium.org> - 2016-06-21 19:30 +0200
Re: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-21 20:10 +0200
Re: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Rik van Riel <riel@redhat.com> - 2016-06-21 20:10 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Andy Lutomirski <luto@amacapital.net> - 2016-06-21 21:50 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Kees Cook <keescook@chromium.org> - 2016-06-21 22:20 +0200
Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Arnd Bergmann <arnd@arndb.de> - 2016-06-21 21:50 +0200
csiph-web