From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [xen-unstable test] 6947: regressions - trouble: broken/fail/pass Date: Tue, 03 May 2011 14:36:56 +0100 Message-ID: <4DC02118020000780003F666@vpn.id2.novell.com> References: <4DBFE886020000780003F5AD@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> On 03.05.11 at 12:09, Keir Fraser wrote: > On 03/05/2011 10:35, "Jan Beulich" wrote: >=20 >>> Oh, another way would be to make lookup_slot invocations from IRQ = context be >>> RCU-safe. Then the radix tree updates would not have to synchronise on = the >>> irq_desc lock? And I believe Linux has examples of RCU-safe usage of = radix >>> trees -- certainly Linux's radix-tree.h mentions RCU. >>>=20 >>> I must say this would be far more attractive to me than hacking the = xmalloc >>> subsystem. That's pretty nasty. >>=20 >> I think that I can actually get away with two stage insertion/removal >> without needing RCU, based on the fact that prior to these changes >> we have the translation arrays also hold zero values that mean "does >> not have a valid translation". Hence I can do tree insertion (removal) >> with just d->event_lock held, but data not yet (no longer) populated, >> and valid <-> invalid transitions only happening with the IRQ's >> descriptor lock held (and interrupts disabled). All this requires is = that >> readers properly deal with the non-populated state, which they >> already had to in the first version of the patch anyway. >=20 > But the readers in irq context will call lookup_slot() without d->event_l= ock > held? In that case you do need an RCU-aware version of radix-tree.[ch], > because lookups can be occurring concurrently with insertions/deletions. No, in IRQ context we only need the irq -> pirq translation afaics, and that translation doesn't use an allocated object (it instead simply = inserts the [non-zero] pirq as data item). Jan