Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756753AbbLGWzt (ORCPT ); Mon, 7 Dec 2015 17:55:49 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:34567 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756126AbbLGWzr (ORCPT ); Mon, 7 Dec 2015 17:55:47 -0500 MIME-Version: 1.0 In-Reply-To: References: From: Andy Lutomirski Date: Mon, 7 Dec 2015 14:55:27 -0800 Message-ID: Subject: Re: [PATCH 00/12] x86: Rewrite 64-bit syscall code To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Borislav Petkov , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Denys Vlasenko , Linus Torvalds Content-Type: multipart/mixed; boundary=001a11c2b464fadd9f052656c1e8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5062 Lines: 81 --001a11c2b464fadd9f052656c1e8 Content-Type: text/plain; charset=UTF-8 On Mon, Dec 7, 2015 at 1:51 PM, Andy Lutomirski wrote: > This is kind of like the 32-bit and compat code, except that I > preserved the fast path this time. I was unable to measure any > significant performance change on my laptop in the fast path. > > What do you all think? For completeness, if I zap the fast path entirely (see attached), I lose 20 cycles (148 cycles vs 128 cycles) on Skylake. Switching between movq and pushq for stack setup makes no difference whatsoever, interestingly. I haven't tried to figure out exactly where those 20 cycles go. --Andy --001a11c2b464fadd9f052656c1e8 Content-Type: text/x-patch; charset=US-ASCII; name="zap_fastpatch.patch" Content-Disposition: attachment; filename="zap_fastpatch.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ihwk0u290 ZGlmZiAtLWdpdCBhL2FyY2gveDg2L2VudHJ5L2VudHJ5XzY0LlMgYi9hcmNoL3g4Ni9lbnRyeS9l bnRyeV82NC5TCmluZGV4IDFhYjUzNjJmMjQxZC4uYTk3OT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Q0VfSVJRU19JUkVUUQkJLyogd2UncmUgYWJvdXQgdG8g Y2hhbmdlIElGICovCiAKQEAgLTMwNSwxNCArMjUxLDcgQEAgb3Bwb3J0dW5pc3RpY19zeXNyZXRf ZmFpbGVkOgogRU5EKGVudHJ5X1NZU0NBTExfNjQpCiAKIEVOVFJZKHN0dWJfcHRyZWdzXzY0KQot CS8qCi0JICogU3lzY2FsbHMgbWFya2VkIGFzIG5lZWRpbmcgcHRyZWdzIHRoYXQgZ28gdGhyb3Vn aCB0aGUgZmFzdCBwYXRoCi0JICogbGFuZCBoZXJlLiAgV2UgdHJhbnNmZXIgdG8gdGhlIHNsb3cg cGF0aC4KLQkgKi8KLQlESVNBQkxFX0lOVEVSUlVQVFMoQ0xCUl9OT05FKQotCVRSQUNFX0lSUVNf T0ZGCi0JYWRkcQkkOCwgJXJzcAotCWptcAllbnRyeV9TWVNDQUxMNjRfc2xvd19wYXRoCisJdWQy CiBFTkQoc3R1Yl9wdHJlZ3NfNjQpCiAKIC8qCg== --001a11c2b464fadd9f052656c1e8-- -- 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/