Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754464AbeAKVY3 (ORCPT + 1 other); Thu, 11 Jan 2018 16:24:29 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:39654 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752804AbeAKVY2 (ORCPT ); Thu, 11 Jan 2018 16:24:28 -0500 Date: Thu, 11 Jan 2018 22:23:48 +0100 From: Willy Tarreau To: Alan Cox Cc: Josh Poimboeuf , Olivier Galibert , Dave Hansen , Borislav Petkov , Linus Torvalds , Alexei Starovoitov , Andy Lutomirski , Peter Zijlstra , LKML , X86 ML , Brian Gerst , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Greg Kroah-Hartman , Kees Cook Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set Message-ID: <20180111212348.GA15528@1wt.eu> References: <20180111182147.masunghp5km6igjq@ast-mbp.dhcp.thefacebook.com> <20180111183207.dah7imbuvuhvrrk6@treble> <4e32af93-f632-ae17-eed4-c7023c1b9cc5@linux.intel.com> <20180111190700.y4hultq3awxuw6fj@pd.tnic> <6144aefc-767f-ff36-b424-f63f4bd4c579@linux.intel.com> <20180111192601.cck3eq26vorybudk@treble> <20180111193431.7e2d7f63@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180111193431.7e2d7f63@alans-desktop> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 07:34:31PM +0000, Alan Cox wrote: > On Thu, 11 Jan 2018 13:26:01 -0600 > Josh Poimboeuf wrote: > > > On Thu, Jan 11, 2018 at 08:19:35PM +0100, Olivier Galibert wrote: > > > Wouldn't the time taken by an easy syscall like getuid be a clear indicator? > > > > I think only if you had a baseline measurement to compare against. > > getuid can also be cached by a smart libc. getppid() is what micro > benchmarks seem to favour. I initially tried getpid() which I found to be cached by glibc, but I switched to write(-1, "a", 1) in the example in the cover letter and the test for 3 million runs roughly climbs from 200 ms to 900 ms under kvm (with PCID this time, I didn't retest without). Willy