From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 4/6] kvm tools: Add rwlock wrapper Date: Mon, 30 May 2011 10:12:55 +0200 Message-ID: <20110530081255.GJ27557@elte.hu> References: <4DE1EA93.6040401@redhat.com> <20110529073550.GA21254@elte.hu> <4DE1FBA5.6080905@redhat.com> <20110529123755.GC26627@elte.hu> <4DE2409D.1050701@redhat.com> <20110529142747.GA15441@elte.hu> <4DE25F70.5080700@redhat.com> <20110529153854.GH2668@linux.vnet.ibm.com> <20110529193327.GE9835@elte.hu> <20110530030725.GM2668@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Mathieu Desnoyers , Pekka Enberg , Sasha Levin , john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: "Paul E. McKenney" Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:42978 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878Ab1E3INJ (ORCPT ); Mon, 30 May 2011 04:13:09 -0400 Content-Disposition: inline In-Reply-To: <20110530030725.GM2668@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: * Paul E. McKenney wrote: > > The stop_machine_run()-alike thing is for brlocks - for which > > Sasha sent patches already, see these patches on the > > kvm@vger.kernel.org list: > > > > [PATCH 3/4] kvm tools: Add a brlock > > [PATCH 4/4] kvm tools: Use brlock in MMIO and IOPORT > > > > Wrt. brlocks, we'll keep them as simple as possible and indeed no > > involved tricks are needed AFAICS. read_lock() will be a compiler > > barrier(), that's as fast as it gets :-) > > Makes sense! > > The other debugging use for the read-side primitives is to execute > the read-side ready-do-respond-to-kvm-pause code. This can help > catch bugs where the developer put the br_read_lock() and the > br_read_unlock() in the wrong place. That's a very good suggestion - it might in fact be simpler to implement than the 'replace by rw_lock' debugging variant. Thanks, Ingo