From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Migration assigned device interrupts Date: Thu, 01 Oct 2009 16:50:51 +0200 Message-ID: <4AC4C1CB.9040903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Yang, Sheng" , Chris Wright Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61693 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932639AbZJAOuw (ORCPT ); Thu, 1 Oct 2009 10:50:52 -0400 Sender: kvm-owner@vger.kernel.org List-ID: It occurs to me that we're handling assigned device interrupts inefficiently: an interrupt is received on cpu A, injected, and wakes up (or forces out of guest mode) a vcpu on cpu B. This involved an IPI and bothers two cpus instead of one. But we often known which vcpu will be woken up (DM_FIXED interupts) and which cpu it runs on (vcpu->cpu, preempt notifiers) so we can migrate the host interrupt to follow the vcpu it wakes. This should improve latency and cpu utilization. I'm not sure how to do this generically (with irqfd), so vhost-net can benefit from it as well - migrate the vhost threads and the interrupts that feed them too. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.