Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbbDXBAi (ORCPT ); Thu, 23 Apr 2015 21:00:38 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59714 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbbDXBAg (ORCPT ); Thu, 23 Apr 2015 21:00:36 -0400 Message-ID: <5539958D.7000405@zytor.com> Date: Thu, 23 Apr 2015 17:59:57 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Andy Lutomirski CC: Borislav Petkov , Denys Vlasenko , Linus Torvalds , Brian Gerst , Denys Vlasenko , Ingo Molnar , Steven Rostedt , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH] x86/asm/entry/32: Restore %ss before SYSRETL if necessary References: <1429792491-5978-1-git-send-email-dvlasenk@redhat.com> <20150423211015.GS28327@pd.tnic> <55396617.4020303@zytor.com> <553972D5.2070104@zytor.com> <553977AA.9040802@zytor.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1475 Lines: 38 On 04/23/2015 03:55 PM, Andy Lutomirski wrote: > On Thu, Apr 23, 2015 at 3:52 PM, H. Peter Anvin wrote: >> On 04/23/2015 03:38 PM, Andy Lutomirski wrote: >>>> >>>> Because there are way more sysrets than context switches, and Linux is >>>> particularly sensitive to system call latency, by design. >>> >> >> Just to clarify: why would Linux be more sensitive to system call by >> design? It enables much simpler APIs and avoids hacks like sending down >> a syscall task list (which was genuinely proposed at one point.) If >> kernel entry/exit is too expensive, then the APIs get more complex >> because they *have* to do everything in the smallest number of system calls. >> > > It's a matter of the ratio, right? One cycle of syscall overhead > saved is worth some number of context switch cycles added, and the > ratio probably varies by workload. > Correct. For workloads which do *no* system calls it is kind of "special". > If we do syscall, two context switches, and sysret, then we wouldn't > have been better off fixing it on sysret. But maybe most workloads > still prefer the fixup on context switch. > There is also a matter of latency, which tends to be more critical for syscall. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/