From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH stub] kvm: caching API for interrupts Date: Sun, 29 Jul 2012 23:29:22 +0300 Message-ID: <20120729202922.GA13772@redhat.com> References: <20120729200058.GA13557@redhat.com> <50159721.4000909@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15672 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466Ab2G2U2j (ORCPT ); Sun, 29 Jul 2012 16:28:39 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6TKScVC025707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 29 Jul 2012 16:28:38 -0400 Content-Disposition: inline In-Reply-To: <50159721.4000909@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Jul 29, 2012 at 10:03:45PM +0200, Paolo Bonzini wrote: > Il 29/07/2012 22:00, Michael S. Tsirkin ha scritto: > > I've been looking at adding caching for IRQs so that we don't need to > > scan all VCPUs on each interrupt. One issue I had a problem with, is > > how the cache structure can be used from both a thread (to fill out the > > cache) and interrupt (to actually send if cache is valid). > > > > For now just added a lock field in the cache so we don't need to worry > > about this, and with such a lock in place we don't have to worry about > > RCU as cache can be invalidated simply under this lock. > > seqlock? > > Paolo AFAIK seqlock only works if uses of stale data have no side-effects, this is not the case here. We could use an rwlock I think. -- MST