Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936460AbcLOO5d (ORCPT ); Thu, 15 Dec 2016 09:57:33 -0500 Received: from mail-ve1eur03hn0200.outbound.protection.outlook.com ([104.47.9.200]:11629 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932595AbcLOO5Q (ORCPT ); Thu, 15 Dec 2016 09:57:16 -0500 X-Greylist: delayed 21030 seconds by postgrey-1.27 at vger.kernel.org; Thu, 15 Dec 2016 09:57:16 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Date: Thu, 15 Dec 2016 17:56:58 +0300 From: Roman Kagan To: Paolo Bonzini CC: Radim =?utf-8?B?S3LEjW3DocWZ?= , Denis Plotnikov , , , Subject: Re: [PATCH v2] KVM: x86: avoid redundant REQ_EVENT Message-ID: <20161215145658.GB12110@rkaganb.sw.ru> Mail-Followup-To: Roman Kagan , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Denis Plotnikov , den@virtuozzo.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20161214105908.322638-1-dplotnikov@virtuozzo.com> <20161215071840.GB7704@rkaganb.sw.ru> <20161215143054.GC6667@potion> <4876bc4a-b72a-897e-84a7-c34c3f934705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4876bc4a-b72a-897e-84a7-c34c3f934705@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: DB5PR06CA0029.eurprd06.prod.outlook.com (10.162.165.39) To HE1PR0802MB2474.eurprd08.prod.outlook.com (10.175.34.147) X-MS-Office365-Filtering-Correlation-Id: 19bd6b9e-a80f-455b-0a0b-08d424faa35d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HE1P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zIi9nO/j+MzJH2laR4b+KJhKOaRII9LpJIMfzI24y1ltWfyI3HH6NT X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2474;31:H5uA0jx6mkm2dbMHiGqSX5WWoPf7QmhibXAN/cD7H2+NRpCEHRUq1ZQp2I/mIqhK9b1L9RIveg7DwKXpnmJZ1lkZilkSY6pTB4SgMHfuf387gElKlu5s7mhQCgFhnQ8+uMZxwee9B00PD6zb5P61r+uQ+dkglknj0PFyVN4n0kpdxKRsgAB044qC5kq8RiwwDT7NdGnyF0I71d5SfcLCtTHOk8QftpbUh5SdZh/sbeoZO64PQ4s+y3vYQGBFmbrk;20:7M9pMrh/nswwIg+sdysc6JnM5sc+rjySGrUhW/sPqQ0pH+faxSqMC79C5OAbe+nW4vyoEgJOkuqbRHtDq8p2s3uFjM4y9602bKY39uYBwafB2mnkUFTHIOG8zTs+zn1J8CKAByHx5sa/Y/gPVSPilOPSOTf5v28wmUjzY4TElJ9jWlEjckvZAn8Xhoq972nRxb+bramITllKKNIg7cw8G5ksL4jprnWS/999FzIIXTyAcz8Z9W3pg4jBOFFJGeM8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148);SRVR:HE1PR0802MB2474;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0802MB2474; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2474;4:y/AJT8qMY7kYko0J2ARV6AAhf18Og0voSH45hgjXkqotiUWc6XdrLyEsNqhyVTS8LLpi6Xa7LgQ0wBF2/wB5BBAJnfnW3IToAqc6cn87LWHEwQZBYanHLIlaEMdh+j7ic9LQFTW7icdAveelHoQIUxn4LYQCDtOlkHse0yzDBNG8q/+x0z9PPHdsyhi8pFNCdMjWTWSPQfahZfg5JxpGiwWN71ErYAuusXnPIR36qW/h6PV+wJ51DwTaYZbXaR6bgFxV4P7JD+oXmxEDlvfErvrVElIRxD/GT18/BooV+N0F7od148KgCK38kRswC/gUZlL0s5TVUsV1fJDqXZlQxDq8UOjuFmTNvrPQYgADmErFsZiKFp9CeZhMTg+/eLM+5xMt7OvzRW+YiHldatWpW/gZp5gTmwhQ2KUsrCL4PIHC/sefpqk2Z8oakgY/UC551r1B1pjN9N6jQeBCkuOQppnsm19tOi8HU/LvZ8D9b1Uthm/AKp0nxRVrbHT/JHIgBAUEAnr0adg/r7Zu7G1eE1NS+cLARa3v89NV2N2YVuNPVWuTrnLfFxBPNMrcIjToWgvnPqC383ZZ5VLa2d8/lA== X-Forefront-PRVS: 0157DEB61B X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(189002)(199003)(24454002)(43544003)(68736007)(69596002)(6666003)(6916009)(106356001)(305945005)(4326007)(101416001)(3846002)(1076002)(33656002)(42186005)(5660300001)(6116002)(53416004)(36756003)(8676002)(50986999)(54356999)(9686002)(2950100002)(110136003)(105586002)(23676002)(50466002)(2906002)(76176999)(81166006)(81156014)(66066001)(189998001)(97736004)(86362001)(47776003)(229853002)(4001350100001)(2870700001)(93886004)(6506006)(83506001)(7736002)(38730400001)(92566002)(25786008)(30126002)(18370500001);DIR:OUT;SFP:1501;SCL:5;SRVR:HE1PR0802MB2474;H:rkaganb.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDJNQjI0NzQ7MjM6d3RFd1dmNGRJZnVvZ1NiVWFoMVVQZnRi?= =?utf-8?B?Mk5rdTRlVk9Cbkk1ZmtmMElTczBBZUtvdlcyZEwrTm5Bb08yeEd3MCtBaGVz?= =?utf-8?B?MHhzbEVzanF6Z3VtUWt0dndhUTFTRFNOS045QmM2SUJOVDFvTFIxWE42MHhX?= =?utf-8?B?THM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mbQ4QTitCgeM0Te7dw==;20:EULp3K7WUvD3ly+K36IVEC5xRXCK7wFAqwVpnP/hRO55nMIprtGMIM2nnxMrQgCYtfdh86ekxP/1pdMqA2lZQBHbUeUfH2dw/oRZ/1p7YR5OA/MVoA/ACpoGaolc8s4LQVPU3rQT0Sc+EGgAzT3nZkdJEFl8ch77g2bH54DIiIQ= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2016 14:57:05.7451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2474 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1103 Lines: 26 On Thu, Dec 15, 2016 at 03:32:45PM +0100, Paolo Bonzini wrote: > > > On 15/12/2016 15:30, Radim Krčmář wrote: > > > > One useless round of KVM_REQ_EVENT is not going change nested > > performance by much and it is not the only thing we could improve wrt. > > TPR ... I would just leave it for now and take care of it when we > > * don't to update PPR at all with APICv -- it is already correct > > * drop the KVM_REQ_EVENT with flex priority, because lower TPR cannot > > unmask an interrupt > > I agree. I still don't like the patch very much, because I feel like an > explicit state machine ("can KVM_REQ_EVENT do anything?") would be more > maintainable. We all seem to share that feeling towards this patch :) That's the reason why it was baking here internally for a long time: Denis discovered this scenario over a month ago while analyzing the performance regressions in KVM against our proprietary hypervisor, but pinning down a palatable and safe fix turned out to be a challenge. I think we did our best to stay safe; I agree that it ended up no so beautiful indeed. Roman.