Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbdLMLYP (ORCPT ); Wed, 13 Dec 2017 06:24:15 -0500 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:64555 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751914AbdLMLYM (ORCPT ); Wed, 13 Dec 2017 06:24:12 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Date: Wed, 13 Dec 2017 14:23:55 +0300 From: Yury Norov To: Christian Borntraeger Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Ashish Kalra , Christoffer Dall , Geert Uytterhoeven , Linu Cherian , Sunil Goutham Subject: Re: [PATCH] IPI performance benchmark Message-ID: <20171213112355.s3ubggurwx4v3r53@yury-thinkpad> References: <20171211141600.24401-1-ynorov@caviumnetworks.com> <27744344-f4f3-0952-94e2-d80071a137a7@de.ibm.com> <20171211145557.mooeknrcdfw53qpz@yury-thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [42.107.79.35] X-ClientProxiedBy: DB6PR0402CA0013.eurprd04.prod.outlook.com (2603:10a6:4:91::23) To MWHPR0701MB3833.namprd07.prod.outlook.com (2603:10b6:301:7f::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e701c83-5ce0-4bfe-028c-08d5421c079e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307);SRVR:MWHPR0701MB3833; X-Microsoft-Exchange-Diagnostics: 1;MWHPR0701MB3833;3:X7sQcui41+7NYRnbfey8YHSFLKZG5UV5QqRx3oYPFbFdG4SfsWwaXix5bR7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ejWesOfAbnFMXeQOAZ4vtrjvu56AUgubl+3V4YOY0CULz7zksvKV2gYqgfsMAyp9AcAtoOakTpfJeImU1OzHBQ3Xf7KRPjZK1zK+8gFFkEUCX7QOeo0N0iumZGkftmLWaJPTrXwovNlPNSgza85P+hAt9DTgcbnYlTLsWFf/b9lqADtm8thKE5xgwGjxyeA2Cdpwzq7oZwLPuuE5GQFpCPRCLCDcaB492mGYxArTgJ0/AvOG95IzKqIu/uXa3Qaz0uPHRQVMI7+2SBucPeP8QHCteYGyLc4GKMIK6w25y+Dh6k294vl4hIBU7rla04oYKPIvRfk/4HgGHkLIZLqQs7NyTDccynBUDAETJhs6cjyBac+VhHUGdzngvbuLVHhwNT2CzKHg/3lnnN37fTjqNwwaN1y5YyJNq9yZc7w=;4:koAKYjXmUdIa9xmN0BwvQQfGCQ7SRUGbN5IDLsIWYA9fUZO38eXXkoA27NKEya1H4ZHk+pkGQ2QajsMKwFQok2fAOnGecqi6NevridLnB650KmzPv8lFrIZ3Ke1owvvGYoVouxlQNXsws27E23LUPuwOJS2BDITRSdIM6U0hvSiX3/pmt+Ltj9xPqwpSJsUFBkMR1N0yN5jZR64kQR/kLtMUVtr5sJ7qAkCOoxdmBiDIsqytm83Pk76mPOLhzxBUNJVXJo9jWJUy7mBuKFRJBsg3SIVUVdSeJ+fXA0eLUoilcKKpJzB2+bc0gNYm+9/s X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231023)(93006095)(6041248)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011);SRVR:MWHPR0701MB3833;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR0701MB3833; X-Forefront-PRVS: 052017CAF1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(7916004)(376002)(346002)(366004)(199004)(24454002)(189003)(47776003)(76176011)(478600001)(93886005)(76506005)(6496006)(2950100002)(58126008)(2906002)(16586007)(54906003)(72206003)(25786009)(229853002)(6116002)(33896004)(52116002)(305945005)(316002)(966005)(6916009)(4326008)(1076002)(6306002)(6486002)(9686003)(42882006)(68736007)(6246003)(107886003)(66066001)(33716001)(53936002)(106356001)(6666003)(105586002)(81156014)(8936002)(8676002)(81166006)(5009440100003)(50466002)(3846002)(5660300001)(7736002)(83506002)(16526018)(97736004)(23726003)(386003)(53546011);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR0701MB3833;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR0701MB3833;23:jk30y/88LkX8+KNzHaXyCD9nIKKoUyMSd1BiWbI?= =?us-ascii?Q?IltYYQIMLD3+iIRiRXpfZ3HVvg4pOEh/1kGwoD91xrlNVhvfI/AMKJArs2PT?= =?us-ascii?Q?oVJ4bOO1rl8vIcz9TLbb46gsL8JnwjaeZBhYN2LwNR83n2d3qlKP+OZkEjoY?= =?us-ascii?Q?/xQbfSFkKCoAxjF442XhPoGeOrCM5sVBdR6hCjk9KQb94rHHJHzww9FYb3T4?= =?us-ascii?Q?EzSTmVTNVr2YFUlv0vUlxYFh4+nGqP4V94y9Nq2+KSWHUFloaIn72Pl0LHYM?= =?us-ascii?Q?W05e9de9xphz97dtgbTKqLiG+KyEDDUmAAmuWDdIOFWNq/bU2B3mdEqrVWKt?= =?us-ascii?Q?to46ysOxZxMiZf+yU21DbbJZ9b06MHNLH2BRBOBNq9kbBBqS+7Ej5S0xZmAt?= =?us-ascii?Q?mLgHyDRr3CWullPkvqVzyl2vg0YvNIcue50UzGNpEvrBhvOXGd9Bk+E9Sx+6?= =?us-ascii?Q?qYbe76szBZlH9iP7wp35WtL3FcmgIzabJR7CjAV/978eDRBzgVdRi5M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UE/BWEzqTyFmxADSO1utwW9VJSXdh8CPsye3y4047LvoFR1xAHfIJKv4qlbC+GJr7twXBjy8sULEYRrFlKuu4Xs/e/wtrHmUdmgcoCmiF1k5hfIqXQ/OXUd7clOC5tNyQYcAbuIFQ/MaVYQXBK8u44zcPv57hpbfwV+d6gTX/f4pLWvA8QH+OQjjNpptZBB7WIGeQ/2R6DeoTvChywb7wkWx6w//6AeK/MXUbjLVPpDAPWK74N+aKDfmqLEMepbKUYXJS9WXWbSpG9Ft6CTcgXQMIuIlxXXzRMLP99CBzLEw017uzdeuHD7aW83YNZLlQYK2F3JJCrDqga/bT2X6bDYMY5Ed9jK/E=;5:jEytPgjrUVwbZBCBvLU+o9PGUGTd4G6znq2RUTU81P1JR1vaUPuMl4HFReYUvaUL8Gjcm+VUuvERWVQFTUvCwqyHEQXMGbmwry7fJZXO4ww11Y/hO0kIJIqv9/cysO8C8hmJhSQLt3uuW2E00ozsfQ6GSk1Gez2QFnSo1cYawyQ=;24:kTeclpSZw5nwP4ZKAtH7Ok8o5hXIfNtyw1JK96F7uD/miOoKNbQxseXqheuhDJJ4+QtCiYfY7tI/DYRJLzEOuYDOWT3OVeSgtaov87YRMy8=;7:85xcB8EjpJxYhOaCk7RfvfyqpGkCKxkcNbyBZRC1MHY2HAC3ImTdxiI+/rqHgdKSmkXifpYhApUtLWmPkOwAsvXN0FTCXLngcpc9ZOwNzWpwwucRGdM92DqsO54WiBOT2nwITrkVGkDSqBGTcUYOOnUv4AbXnYcUpveKpLrQIHU2rRbXBh2nWJkWpng3BeagULuRCsCvy8mQwaOlOjkTXxACXuajYus1+ZH2WmcgO+GEBvUX3OlEYnljdbm5VJpF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 11:24:08.6950 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e701c83-5ce0-4bfe-028c-08d5421c079e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3833 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3302 Lines: 84 On Mon, Dec 11, 2017 at 05:30:25PM +0100, Christian Borntraeger wrote: > > > On 12/11/2017 03:55 PM, Yury Norov wrote: > > On Mon, Dec 11, 2017 at 03:35:02PM +0100, Christian Borntraeger wrote: > >> > >> > >> On 12/11/2017 03:16 PM, Yury Norov wrote: > >>> This benchmark sends many IPIs in different modes and measures > >>> time for IPI delivery (first column), and total time, ie including > >>> time to acknowledge the receive by sender (second column). > >>> > >>> The scenarios are: > >>> Dry-run: do everything except actually sending IPI. Useful > >>> to estimate system overhead. > >>> Self-IPI: Send IPI to self CPU. > >>> Normal IPI: Send IPI to some other CPU. > >>> Broadcast IPI: Send broadcast IPI to all online CPUs. > >>> > >>> For virtualized guests, sending and reveiving IPIs causes guest exit. > >>> I used this test to measure performance impact on KVM subsystem of > >>> Christoffer Dall's series "Optimize KVM/ARM for VHE systems". > >>> > >>> https://www.spinics.net/lists/kvm/msg156755.html > >>> > >>> Test machine is ThunderX2, 112 online CPUs. Below the results normalized > >>> to host dry-run time. Smaller - better. > >>> > >>> Host, v4.14: > >>> Dry-run: 0 1 > >>> Self-IPI: 9 18 > >>> Normal IPI: 81 110 > >>> Broadcast IPI: 0 2106 > >>> > >>> Guest, v4.14: > >>> Dry-run: 0 1 > >>> Self-IPI: 10 18 > >>> Normal IPI: 305 525 > >>> Broadcast IPI: 0 9729 > >>> > >>> Guest, v4.14 + VHE: > >>> Dry-run: 0 1 > >>> Self-IPI: 9 18 > >>> Normal IPI: 176 343 > >>> Broadcast IPI: 0 9885 > [...] > >>> +static int __init init_bench_ipi(void) > >>> +{ > >>> + ktime_t ipi, total; > >>> + int ret; > >>> + > >>> + ret = bench_ipi(NTIMES, DRY_RUN, &ipi, &total); > >>> + if (ret) > >>> + pr_err("Dry-run FAILED: %d\n", ret); > >>> + else > >>> + pr_err("Dry-run: %18llu, %18llu ns\n", ipi, total); > >> > >> you do not use NTIMES here to calculate the average value. Is that intended? > > > > I think, it's more visually to represent all results in number of dry-run > > times, like I did in patch description. So on kernel side I expose raw data > > and calculate final values after finishing tests. > > I think it is highly confusing that the output from the patch description does not > match the output from the real module. So can you make that match at least? I think so. That's why I noticed that results are normalized to host dry-run time, even more, they are small and better for human perception. I was recommended not to public raw data, you'd understand. If this is the blocker, I can post results from QEMU-hosted kernel. > > If you think that average values are preferable, I can do that in v2. > > The raw numbers a propably fine, but then you might want to print the number of > loop iterations in the output. It's easy to do. But this number is the same for all tests, and what really interesting is relative numbers, so I decided not to trash output. If you insist on printing iterations number, just let me know and I'll add it. > If we want to do something fancy, we could do a combination of a smaller inner > loop doing the test, then an outer loops redoing the inner loop and then you > can do some min/max/average calculation. Not s