Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755590AbcLSNkZ (ORCPT ); Mon, 19 Dec 2016 08:40:25 -0500 Received: from mail-db5eur01on0093.outbound.protection.outlook.com ([104.47.2.93]:54199 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753990AbcLSNkV (ORCPT ); Mon, 19 Dec 2016 08:40:21 -0500 X-Greylist: delayed 1122 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Dec 2016 08:40:20 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=dplotnikov@virtuozzo.com; Subject: Re: [RFC PATCH v3 0/6] KVM: x86: avoid redundant REQ_EVENT To: Paolo Bonzini , , References: <1482140838-6303-1-git-send-email-pbonzini@redhat.com> CC: , From: Denis Plotnikov Message-ID: Date: Mon, 19 Dec 2016 16:05:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482140838-6303-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: DB6PR1001CA0001.EURPRD10.PROD.OUTLOOK.COM (10.171.79.11) To AM4PR0802MB2212.eurprd08.prod.outlook.com (10.172.217.138) X-MS-Office365-Filtering-Correlation-Id: 06f8009c-f6e1-4f97-a398-08d4280fe1f4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:AM4PR0802MB2212; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0802MB2212;3:p4ZgVzZbie0ZrR6ZtlnPEDFkrmBuZd3XBgXG6z2XhlDdnkeYs/mhjkJIV1a8bUJXbgQaHaGD1MvrjYAKT9Vgb9yL1i77qo9H1xWX3CZ9UxagsBalkjU+N4pAweSHS6/pqpzU69nu3mZK4C+kME4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X5yBoRUiD8d8de4A0YVv/tQInqFXfG1pu/xgSJl/frxTjfMnGvWXnNWr1+K7wBWTxEsuDQPVLDqFF5F0S1bUq+HBIKDZR74HJBnQ/Z+6PnmPbFbKThG53/Sah/H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148);SRVR:AM4PR0802MB2212;BCL:0;PCL:0;RULEID:;SRVR:AM4PR0802MB2212; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0802MB2212;4:d0DsuAn9EVxUL7dnUZmDsWz7PNsDBeocVjrf2cReLUZUQn2F369nIglux1AWZwEZGBTqzWZ2UX9hamzlNnu+dUctIu8awXhmVOFcVwkWhFjexlK9+orSO30hXAdq4BuJV/BvVTI1IRozBLXr6d9K0YA5OR4A0hc20v/eCkfi4ruNmoWsxZFgXclw4tNvb2CDQg3VpxCt3zSx6Vnp+rj4rYH/l8O+UHhD6tXeyO+F9kJsyiEwYTR54BxT+Ln7an4EDPUCkQXLhOBpEmPmVT/+xo8W7EnK272Kabt6LgLAABpf9n43jSLGJ92yVAWAz6qYmuZ1AXp7KjNnR3+3rcPTBcZOvzMCXHlc26gU2njHv8pyRTxIoH1pRSrfszwMq1cZuceM0g2lL25MVif4hsaaJgsU6LNStf8V0grMcRrwcy3YaUj1VBYN+RgJxJUHCRgY3g0HWy/MleiLzn4AHwWRaYE+RUzXfUjyGd9M+F0CypdP1cDZKPgcCcJPVtMqI2yCZ44l8qyO0HmnlOWCFDagYIytBo3D/ilAcxrv3rnFqBqzwe3FzlFjRIiChVGW5q9b8uVSfXzq9raoms77W1e6upD2fglSYmDv7L09CG7TDJguWbxWi8ypZom/CQO3idZv X-Forefront-PRVS: 01613DFDC8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39450400003)(24454002)(189002)(199003)(53474002)(6116002)(101416001)(229853002)(6486002)(4001350100001)(50466002)(5001770100001)(97736004)(77096006)(107886002)(64126003)(6666003)(81166006)(189998001)(81156014)(2950100002)(31696002)(31686004)(83506001)(42186005)(38730400001)(25786008)(5660300001)(23746002)(65826007)(3846002)(305945005)(230700001)(7736002)(54356999)(2906002)(50986999)(36756003)(106356001)(76176999)(4001430100002)(8676002)(105586002)(68736007)(4326007)(86362001)(90366009)(2201001)(33646002)(47776003)(65806001)(65956001)(66066001)(92566002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR0802MB2212;H:[10.30.4.98];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;AM4PR0802MB2212;23:z/5xdCm1cnyyd/n4cUgP9ZdhFnqu/LpbGcJ?= =?Windows-1252?Q?IDQDLGJx3tRzHfZ5dvz3RXs6YNZ/Hz6nmmLFrsh7y/AH+nm1seixpYI6?= =?Windows-1252?Q?rnJEYV17WyoFw5fqrEweiLqpQ09ROuJHMTcloyI6/thv4JRIMT0DUEtN?= =?Windows-1252?Q?7QITad3vOv2Bn2mbMnlAZ/nieu5EplVW8MwyGeizJXo0j+KbgvhvvyYa?= =?Windows-1252?Q?PuPl8/w5mBwVy3+m0/inqZLzHLwA+LLC3znhAVAUqZ3xkSbIFvHvYIHo?= =?Windows-1252?Q?7P3sfSD8g0LJYitvMaY9rTTyZCnw4k6BSrLaykumc6vGECortPGbvf+Q?= =?Windows-1252?Q?2tzBTIIEo2S+p392z+RQWBJw1cXSiW9XitJ3QjijEx828FV6p7qLO2uQ?= =?Windows-1252?Q?w3fFqP8VLP+eCsqx++40suSqLh3AvXEUGNEsqr0wRJzqa+kKZXJf8pwj?= =?Windows-1252?Q?Gt8ae1WBYyr9f1narPT+hXTlcjyd09pRHBMOf9GsQ/DGTZxKVJ1JJdBO?= =?Windows-1252?Q?+eBk3V6AIPnbd/eIfLeC1lPrDwLrFbhYM57SsMafuDCJSMl54esEEicK?= =?Windows-1252?Q?h3cff/TmJH/5e8TvlMdT5l20yHwPFOwqe9e3ju/uBKYmGAVWRiLStHHv?= =?Windows-1252?Q?py7djsvKLHf31pFpxoBjahVD7KSgBaHJF89WeZiZ+z7gFNWvjf6o93AO?= =?Windows-1252?Q?tb75BeC0q2XQqJIjlOWj6DaPjLv2AyAY3M5rSSrkg5KMtb1qxaTkP7BL?= =?Windows-1252?Q?99CiAAVVRlH20tydJxuy/PAA0BYe/jiVv33LXky1tIGjXEUCpFhkfjht?= =?Windows-1252?Q?bc2q1OkXxCoJQioTGF21mobtx8CNTjqQGp937W29vatFdvSrnFGZb69A?= =?Windows-1252?Q?0dFZ8uhDmlR+rxdyeLHaP2Luld9iDqObWxzlV02bxJD0j6cbtyAJlGYO?= =?Windows-1252?Q?NLe7yMMJH5oLjZb6fHYhIpJwHlN1Rmw10RZbKNr8tHnJ5dRt/U02JiEW?= =?Windows-1252?Q?rhS7BiT++oeoiVECS5AivPw2nL/qYu8TA77xiKN8oSqZzeBxZ1/oK5BT?= =?Windows-1252?Q?LC0zdd8oXOiekpS1q/hciV21eQ86YhkdZpEuHf44JTA+2w0AGiZDomNA?= =?Windows-1252?Q?OZK68ObzBgohkJE54jdahomnmcqo6gaNWONlSQ2TDsXN/QgWORX1/9Bg?= =?Windows-1252?Q?1OTLNW5ucHttHf2ULH0rIjEwgkQGymi4nYHF0gvR59R/OH2ZwKS8tO/W?= =?Windows-1252?Q?hQ2LFKCk8qCsUnHBQG7oIZ5uBS8V2cJwyFpeGfA+a8z2vg9iwiiqyoJf?= =?Windows-1252?Q?OqPJEywpO8M+9s/D0Y9CUCZET3G9FMBQVls3FIl/jd+J5p2Y2yhIbt5c?= =?Windows-1252?Q?xIk+z+zYvT4UdlXbdUOsZ45+Fc0C+aYiAtNsKIpnjcFr2alSfM9NwxSa?= =?Windows-1252?Q?UaAKyBwCkI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g+KH9QDcFiuW+faRoYMcFR1WIU/nuk/Sju2PmWF9VsalpNTzhvDm9DNzZDkDaAyVHlM6hLGky1S2JT6o2ddXln1ZF47haEhbSjLfbYSlZOJsLh0F9rl1Pub2Wmz5StZeZGs3/pkcDkm3yEIOMruFbdtKO0VP9jlkdm/gZzSn7bouL/K5u91jHM+3/lfg/qqZ8Hpv8AWQtun3C6SieZeBfq8QZ97Oo+9M3U4BmyI+HwYnZWiEzmvGurqt1nJnRp2GmNGUTHcy0BsDJIxz9TNb9c+jeXJ0fst5EYHIxLvU6D4Tj8yfN3nEPnY+mbK/gY9y1BZkPMiGVKM8BzxB5096hypPr/9PQudj7TQ==;20:ur19i7nbwunMsOSZ58dDjef01mZQGdvrVkRptSAB2Y+XPrKyOTTiO2v4KI1Lp3KZ6tupIc0h1wy2W50c76sy23gARDtHLDIEWvtzp0R6v5zslrwgvNzY3a/yElKTylyT0lA7nZKJpvbP38ELfADJ+6i+tJC32YpTHKLUOSgCa4k= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 13:06:44.0394 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2212 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1992 Lines: 58 On 19.12.2016 12:47, Paolo Bonzini wrote: > This is the result of cleaning up the places that set REQ_EVENT unnecessarily. > The savings on self-IPI kvm-unit-tests are: > > self_ipi_sti_nop ~300 clock cycles > self_ipi_sti_hlt ~300 clock cycles > self_ipi_tpr ~400 clock cycles > self_ipi_tpr_sti_nop ~700 clock cycles > self_ipi_tpr_sti_hlt ~700 clock cycles > > which is in the 5-10% range. Please help me comparing this series with > "[PATCH v2] KVM: x86: avoid redundant REQ_EVENT" on the real workload! > > Thanks, > > Paolo This new patch-set does avoid unnecessary interrupt re-injections - checked. The test (MS Windows, sending messages between multiple windows using windows-specific interface), which showed performance growth with "[PATCH v2] KVM: x86: avoid redundant REQ_EVENT" showed pretty much the same performance level with this new patch-set. The test score difference (+2.4% to [PATCH v2]) is within the tolerance range(5%). The test score on mainstream v4.9 kernel CPU Intel i5-2400, guest Windows Server 2012 2VCPU, 2GB: without patch: 31510 (+/- 4%) with patch: 36270 (+/- 5%) difference = (36270-31510)/31510 * 100 = +15% -- looks good! Thanks! > > Paolo Bonzini (6): > KVM: x86: add VCPU stat for KVM_REQ_EVENT processing > KVM: lapic: do not set KVM_REQ_EVENT unnecessarily on EOI > KVM: vmx: speed up TPR below threshold vmexits > KVM: lapic: remove unnecessary KVM_REQ_EVENT on PPR update > KVM: lapic: do not set KVM_REQ_EVENT unnecessarily on PPR update > KVM: lapic: do not scan IRR when delivering an interrupt > > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/kvm/lapic.c | 58 +++++++++++++++++++++++++---------------- > arch/x86/kvm/lapic.h | 1 + > arch/x86/kvm/vmx.c | 2 +- > arch/x86/kvm/x86.c | 2 ++ > 5 files changed, 41 insertions(+), 23 deletions(-) > -- Best, Denis