From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: assign-dev: Purpose of interrupt_work Date: Mon, 12 Oct 2009 10:39:13 +0200 Message-ID: <20091012083913.GX16702@redhat.com> References: <4AD2D4B6.7030203@web.de> <20091012071310.GT16702@redhat.com> <4AD2DA57.6030006@web.de> <20091012074513.GV16702@redhat.com> <4AD2DFE2.4050406@web.de> <20091012075715.GW16702@redhat.com> <4AD2E5F8.4070107@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28438 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754685AbZJLIjl (ORCPT ); Mon, 12 Oct 2009 04:39:41 -0400 Content-Disposition: inline In-Reply-To: <4AD2E5F8.4070107@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Oct 12, 2009 at 10:16:56AM +0200, Jan Kiszka wrote: > >>> Apic is lockless. For ioapic/pic I used spinlocks initially, but Avi > >>> prefers mutexes. Theoretically it is possible to make them lockless, > >>> but code will be complex and eventually more slow, since more then two > >>> atomic operation will be used on irq injection path. > >> Well, lockless is another thing. > >> > >> But also converting to spinlocks would indeed add some overhead: > >> irqsave/restore. But I wonder if this isn't worth it, at least when > >> looking at the (supposed to be fast) device passthrough scenario which > >> would be simpler and faster. > >> > > Avi's point in favor of mutex is: they are as fast as spinlocks when > > congested and allows preemption when held. > > ...but require scheduler activity in case of dev-passthrough, which is > surely playing in a different league. > I'd rather remove dev-passthrough completely than continue adding hack upon hack upon hack to make is some times kinda sorta work :) -- Gleb.