From owner-freebsd-current@freebsd.org Thu Mar 8 22:04:12 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A012BF34CFE for ; Thu, 8 Mar 2018 22:04:12 +0000 (UTC) (envelope-from arshan@freebsdfoundation.org) Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4008F72EE9 for ; Thu, 8 Mar 2018 22:04:12 +0000 (UTC) (envelope-from arshan@freebsdfoundation.org) Received: by mail-qk0-x236.google.com with SMTP id s188so1507390qkb.2 for ; Thu, 08 Mar 2018 14:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsdfoundation.org; s=gfnp-20170908; h=mime-version:from:date:message-id:subject:to; bh=KYtdSp3KTqs8NY5Z6trqPf3J7o79H/KOiqijqPJz/aI=; b=Clk7V5ZJeobPJ9nmRi8d1A2Oi1GC+JkBkCOwhUIrZa6ejGmpQLRhw487wrtB2aiPuq xJPkdDxWvbaghZLJK5xaXE827Zicad8SB6YliAtchlN2Tt+be2loUaOYdf/D9pbCRToC EPnTcF8+f4bQT6EpsDBrvvchuWdMiOZ+P6ABxyriWpnGcdjebjDtNR+YtikNlRDvLrZF P8YE42XaksCDxu1BLuPTESL22FHh28yTMu2GMOGHRTPecrGhu61FhTo0IofqimWS1WEm I72PQQRRXvbrcCDoMubuX4K2u691iAEgZiXm073hLzVJ0weeOc34c8P6BkUtLsiToUAM d2Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KYtdSp3KTqs8NY5Z6trqPf3J7o79H/KOiqijqPJz/aI=; b=q2oN1SivFFrA1GgOTCkfYWMptnJIhImaxp28jHcmx3EYVWDfT6bCYeROW1+Rf1lM/I kxx+ph/U4UBV7bJQQmmtblJZNICRz+4dJVmwm4v3O8wQhLU/z3++iBKTRI+5wP19y1e8 TG981ObWaeQ5RgR8ieGmsKPlN5Mwb108fR+DWT/7VTAI9CeTOxWYShR1KkuA3TA43aY5 Q5aUN6o7YkS5ttJo57y35ZCbk5Qgu26rFNVqEljP8pYZ0tzWStwMAuAljBsyUi1v0kD7 ghbkk7EP4Z3r9Os0B+ie95qrbMgDyoNEme+kFgCi5e6G/nyE1ZlqEp6E/B/0FU+DNFq+ XdIw== X-Gm-Message-State: AElRT7Ew5ZyDVkNg6/xRmabieXy/94S8qEejC2+rqoRMi9f4QAmFhyxC GnSz7SMUoZRT5WxS1r2/la3EAClgyG/vlukMx3fNfFTZ X-Google-Smtp-Source: AG47ELsdYc1NPsmqIUQwT6DP8JUZ/3eMUA/MiM0PsQpewmxlKudUSUjREDaJY+FCN83KSIrU2PijEAGs6juMoLsYHW4= X-Received: by 10.55.122.130 with SMTP id v124mr42041322qkc.140.1520546651603; Thu, 08 Mar 2018 14:04:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.34.82 with HTTP; Thu, 8 Mar 2018 14:04:11 -0800 (PST) From: Arshan Khanifar Date: Thu, 8 Mar 2018 17:04:11 -0500 Message-ID: Subject: Performance Benchmark for PTI (aka Meltdown mitigation) To: freebsd-current@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2018 22:04:13 -0000 Executive Summary: - The PTI feature increases the system call times by more than 100%. - As a macrobenchmark, buildworld was used. Wall clock and user time showed no statistically-significant changes, while system time increased by less than 5%. This email contains the results for benchmarking the performance of the PTI patch on FreeBSD 12-current. As a microbenchmark, timing of getppid(2) system call was used, and as a macrobenchmark, a number of buildworld tasks were timed. The benchmark cases are as follows: 1. PTI off, PCID off 2. PTI off, PCID on 3. PTI on , PCID off 4. PTI on , PCID on Since PCID is an optimization and is usually enabled by default, the two most interesting cases above are the cases (2) and (4). Other cases were measured for demonstration of PCID's effect on overall time. The results section for each test is the output of ministat(1) for all the data gathered for that test. Ministat compares the first input file with all the other input files and reports the difference. For more information, check out the man page of ministat(1). ********************************** REVISION: HEAD (b21ccf63f28) ********************************** ************************** Benchmark: Syscall microbenchmark from tools/tools/syscall_timing ./syscall_timing getppid ************************** **************** Hardware: Packet's baremetal type 2 2 x Intel(R) Xeon(TM) CPU E5-2650 v4 (24 cores @ 2.20GHz) 256GB DDR4 ECC RAM 2.8TB SSD **************** ******** results: ******** x pti-off-pcid-on.log + pti-off-pcid-off.log * pti-on-pcid-off.log % pti-on-pcid-on.log +------------------------------------------------------------------------+ | * % * | | * % * | | * % * | | * % * | | * %% ** | | * +x + x %% % *O * *| ||_MA_|| |__M__A____| |___M___A_______| | +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 10 118 162 118 123.9 14.192721 + 10 118 154 118 122.5 11.42366 No difference proven at 95.0% confidence * 10 339 454 340 356.4 37.883447 Difference at 95.0% confidence 232.5 +/- 26.8779 187.651% +/- 29.8653% (Student's t, pooled s = 28.6058) % 10 262 342 262 272.2 25.301735 Difference at 95.0% confidence 148.3 +/- 19.2744 119.693% +/- 21.5323% (Student's t, pooled s = 20.5135) ********************************** REVISION: HEAD (c9cf79445478) ********************************** ************************** Benchmark: buildworld, invoked with this command: make -C /usr/src -j48 buildworld > build.log 2>&1 ************************** **************** Hardware: Packet's baremetal type 2 2 x Intel(R) Xeon(TM) CPU E5-2650 v4 (24 cores @ 2.20GHz) 256GB DDR4 ECC RAM 2.8TB SSD **************** ******** results: ******** x real-pti-off-pcid-on.log + real-pti-off-pcid-off.log * real-pti-on-pcid-off.log % real-pti-on-pcid-on.log +------------------------------------------------------------------------+ | x + % x % + % * * + x *| ||______________|_|___M_A__AMAM|___|____M_|_____|_A__________________| | +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1677.08 1712.18 1691.4 1693.5533 17.6488 + 3 1686.9 1706.72 1697.84 1697.1533 9.9278262 No difference proven at 95.0% confidence * 3 1703.57 1729.55 1705.3 1712.8067 14.52593 No difference proven at 95.0% confidence % 3 1688.69 1701.44 1695.96 1695.3633 6.3959075 No difference proven at 95.0% confidence x user-pti-off-pcid-on.log + user-pti-off-pcid-off.log * user-pti-on-pcid-off.log % user-pti-on-pcid-on.log +--------------------------------------------------------------------------+ | *+ x % % +x % * * *| ||_|__M____MA_A_|______M_|_A__________| |___MA_____|| +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 50223.23 50409.49 50273.89 50302.203 96.303845 + 3 50226.37 50401.75 50230.85 50286.323 99.98752 No difference proven at 95.0% confidence * 3 50754.05 50842.26 50781.66 50792.657 45.121459 Difference at 95.0% confidence 490.453 +/- 170.45 0.975014% +/- 0.341564% (Student's t, pooled s = 75.201) % 3 50342.4 50535.65 50380.41 50419.487 102.37983 No difference proven at 95.0% confidence x sys-pti-off-pcid-on.log + sys-pti-off-pcid-off.log * sys-pti-on-pcid-off.log % sys-pti-on-pcid-on.log +--------------------------------------------------------------------------+ |+x + x+x % %% * * * | ||_|____A__A___M|__| |_____A_M__| |__________A_M_______|| +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 2623.5 2658.68 2652.31 2644.83 18.74489 + 3 2620.79 2654.58 2637.55 2637.64 16.89518 No difference proven at 95.0% confidence * 3 2740.31 2787.22 2772.59 2766.7067 24.002026 Difference at 95.0% confidence 121.877 +/- 48.8099 4.60811% +/- 1.87816% (Student's t, pooled s = 21.5345) % 3 2710.22 2733.57 2730.79 2724.86 12.75458 Difference at 95.0% confidence 80.03 +/- 36.338 3.0259% +/- 1.40248% (Student's t, pooled s = 16.032)