From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbbCJN0R (ORCPT ); Tue, 10 Mar 2015 09:26:17 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:43363 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbbCJN0N (ORCPT ); Tue, 10 Mar 2015 09:26:13 -0400 Date: Tue, 10 Mar 2015 14:26:06 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: Denys Vlasenko , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 3/4] x86: save user rsp in pt_regs->sp on SYSCALL64 fastpath Message-ID: <20150310132606.GC26185@gmail.com> References: <1425926364-9526-1-git-send-email-dvlasenk@redhat.com> <1425926364-9526-4-git-send-email-dvlasenk@redhat.com> <20150310125151.GB21686@gmail.com> <54FEEF0D.5080505@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > > Since this patch does add two extra MOVs, > > I did benchmark these patches. They add exactly one cycle > > to system call code path on my Sandy Bridge CPU. > > Personally, I'm willing to pay that cycle. It could be a bigger > savings on context switch, and the simplification it enables is > pretty good. But, but ... context switches are a relative slow path, compared to system calls. And I say this with the scheduler maintainer hat on as well. So this is not a good bargain IMHO, assuming it's not some _huge_ difference in maintainability - but having an extra percpu field isn't really much of a problem. I don't claim that we couldn't in some other situation decide that a certain type of speedup isn't worth it - but what's the big problem here? A bit of arithmetics shouldn't be a problem? Thanks, Ingo