From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbdFIH3x (ORCPT ); Fri, 9 Jun 2017 03:29:53 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35009 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbdFIH3v (ORCPT ); Fri, 9 Jun 2017 03:29:51 -0400 Subject: Re: [PATCH 2/4] KVM: VMX: avoid double list add with VT-d posted interrupts To: Peter Xu Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Longpeng , Huangweidong , Gonglei , wangxin , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <20170606105707.23207-1-pbonzini@redhat.com> <20170606105707.23207-3-pbonzini@redhat.com> <20170608065057.GB3628@pxdev.xzpeter.org> <463359347.7021259.1496905239878.JavaMail.zimbra@redhat.com> <20170608091644.GD3628@pxdev.xzpeter.org> <5cfad7aa-9069-5419-b0b3-41df74a4f551@redhat.com> <20170609025044.GH3628@pxdev.xzpeter.org> From: Paolo Bonzini Message-ID: <821f022f-ff94-876d-2426-8b6ab35af65f@redhat.com> Date: Fri, 9 Jun 2017 09:29:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170609025044.GH3628@pxdev.xzpeter.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2017 04:50, Peter Xu wrote: > Even, I'm thinking whether we can unconditionally setup PDST only in > pi_load(), then post_block() only needs to handle the NV bit. No, you can't do that without fiddling with the blocked_vcpu lists in pi_load. > (PS. since I'm at here... could I ask why in pi_pre_block we need to > udpate PDST as well? I guess that decides who will run the > wakeup_handler code to kick the vcpu thread, but would that really > matter?) For this one it's a yes. :) I think it's not needed anymore indeed after these patches; see this comment: /* * The wakeup_handler expects the VCPU to be on the * blocked_vcpu_list that matches ndst. Interrupts * are disabled so no preemption should happen, but * err on the side of safety. */ So we could add a WARN. Paolo