[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWsACBdKsZBx29M7O8BGvOhSs=VfNUD3bWDhjR7kY5_hA@mail.gmail.com>
Date: Sun, 26 Apr 2015 16:36:37 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Denys Vlasenko <vda.linux@...glemail.com>
Cc: Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Brian Gerst <brgerst@...il.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor
attribute issue
On Fri, Apr 24, 2015 at 7:17 PM, Denys Vlasenko
<vda.linux@...glemail.com> wrote:
> On Fri, Apr 24, 2015 at 10:50 PM, Andy Lutomirski <luto@...capital.net> wrote:
>> On Fri, Apr 24, 2015 at 1:46 PM, Denys Vlasenko
>>>> This might be way more trouble than it's worth.
>>>
>>> Exactly my feeling. What are you trying to save? About four CPU
>>> cycles of checking %ss != __KERNEL_DS on each switch_to?
>>> That's not worth bothering about. Your last patch seems to be perfect.
>>
>> We'll have to do the write to ss almost every time an AMD CPU sleeps
>> in a syscall.
>
> Why do you think so?
> Scheduling from a syscall which decided to block won't require
> writing to %ss, since in this case %ss isn't NULL.
>
> Writing to %ss will happen every time we schedule from an interrupt.
> With timer interrupt every 1 ms it means scheduling at most ~1000
> times per second, if _every_ such interrupt causes task switch.
> This is still not often enough to worry.
OK, you've convinced me. I still think it can happen much more than
~1k times per second due to hrtimers (see my test case) or things like
page faults, but those are all slow paths.
v2 coming.
--
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists