From: Radim =?utf-8?Q?Krcm=C3=A1r?= Subject: Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts Date: Tue, 24 Nov 2015 15:35:58 +0100 Message-ID: <20151124143557.GA24676@potion.brq.redhat.com> References: <1447037208-75615-1-git-send-email-feng.wu@intel.com> <20151116190314.GA12245@potion.brq.redhat.com> <564AF645.5010506@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: "Wu, Feng" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-11-24 01:26+0000, Wu, Feng: >> From: Paolo Bonzini [mailto:pbonzini@redhat.com] >> On 16/11/2015 20:03, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >> > 2015-11-09 10:46+0800, Feng Wu: >> >> Use vector-hashing to handle lowest-priority interrupts for >> >> posted-interrupts. As an example, modern Intel CPUs use this >> >> method to handle lowest-priority interrupts. >> > >> > (I don't think it's a good idea that the algorithm differs from no= n-PI >> > lowest priority delivery. I'd make them both vector-hashing, whi= ch >> > would be "fun" to explain to people expecting round robin ...) >>=20 >> Yup, I would make it a module option. Thanks very much Radim for >> helping with the review. >=20 > Thanks for your guys' review. Yes, we can introduce a module option > for it. According to Radim's comments above, we need use the > same policy for PI and non-PI lowest-priority interrupts, so here is = the > question: for vector hashing, it is easy to apply it for both non-PI = and PI > case, however, for Round-Robin, in non-PI case, the round robin count= er > is used and updated when the interrupt is injected to guest, but for > PI case, the interrupt is injected to guest totally by hardware, soft= ware > cannot control it while interrupt delivery, we can only decide the > destination vCPU for the PI interrupt in the initial configuration > time (guest update vMSI -> QEMU -> KVM). Do you guys have any good > suggestion to do round robin for PI lowest-priority? Seems Round robi= n > is not a good way for PI lowest-priority interrupts. Any comments > are appreciated! It's meaningless to try dynamic algorithms with PI so if we allow both lowest priority algorithms, I'd let PI handle any lowest priority only with vector hashing. (It's an ugly compromise.)