Date: Mon, 11 Jul 2016 09:06:58 -0700 From: Linus Torvalds <torvalds@...ux-foundation.org> To: Andy Lutomirski <luto@...capital.net> Cc: linux-arch@...r.kernel.org, Nadav Amit <nadav.amit@...il.com>, Mark Rutland <mark.rutland@....com>, Kees Cook <keescook@...omium.org>, Borislav Petkov <bp@...en8.de>, Josh Poimboeuf <jpoimboe@...hat.com>, X86 ML <x86@...nel.org>, Jann Horn <jann@...jh.net>, Heiko Carstens <heiko.carstens@...ibm.com>, Brian Gerst <brgerst@...il.com>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: Re: [PATCH v4 26/29] sched: Allow putting thread_info into task_struct On Jul 11, 2016 7:55 AM, "Andy Lutomirski" <luto@...capital.net> wrote: > > How do you intend to find 'current' to get to the preempt count > without first disabling preemption? Actually, that is the classic case of "not a problem". The thing is, it doesn't matter if you schedule away while looking up current or the preempt count - because both values are idempotent wet scheduling. So until you do the wire that actually disables preemption you can schedule away as much as you want, and after that write you no longer will. This is different wrt a per-cpu area - which is clearly not idempotent wrt scheduling. The reason per-cpu works on x86 is that we have an atomic rmw operation that is *also* atomic wrt the CPU lookup (thanks to the segment base) Linus Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.