Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964937AbeALQhX convert rfc822-to-8bit (ORCPT + 1 other); Fri, 12 Jan 2018 11:37:23 -0500 Received: from smtp-out6.electric.net ([192.162.217.195]:56679 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964832AbeALQhU (ORCPT ); Fri, 12 Jan 2018 11:37:20 -0500 From: David Laight To: 'Willy Tarreau' , 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 Thread-Topic: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set Thread-Index: AQHTiyi0p/EI9VTJykW3F/Uh2c3tDqNwcDwA Date: Fri, 12 Jan 2018 16:37:54 +0000 Message-ID: <8c4e556dd44043aaa2d1ad7e28cec12a@AcuMS.aculab.com> 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> <20180111220659.GD15528@1wt.eu> In-Reply-To: <20180111220659.GD15528@1wt.eu> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Willy Tarreau > Sent: 11 January 2018 22:07 > 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 :-) A system call with a larger kernel memory footprint, and user code that touches more pages, might show an even bigger difference between PTI=on and PTI=off. David