Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933430AbeAKWH3 (ORCPT + 1 other); Thu, 11 Jan 2018 17:07:29 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:39690 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933009AbeAKWH2 (ORCPT ); Thu, 11 Jan 2018 17:07:28 -0500 Date: Thu, 11 Jan 2018 23:06:59 +0100 From: Willy Tarreau To: Linus Torvalds Cc: One Thousand Gnomes , Josh Poimboeuf , Olivier Galibert , Dave Hansen , Borislav Petkov , 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: <20180111220659.GD15528@1wt.eu> References: <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> <20180111212348.GA15528@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 01:28:18PM -0800, Linus Torvalds wrote: > The traditional fast system call to test is getppid(). > > write() goes through a lot more code. Just tried getppid() now, it's relatively similar (slightly slower than write(-1) though, maybe that one aborts very early) : PTI=on : 920ms for 3 million calls PTI=off (prctl) : 230ms for 3 million calls PTI=off (boot) : 215ms for 3 million calls The small difference between the last two very likely comes from the few instructions avoided thanks to the alternatives when pti=off is used at boot. So yes here it's trivial to tell if it's on or off :-) Willy