From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 4/6] kvm tools: Add rwlock wrapper Date: Sun, 29 May 2011 09:19:48 +0200 Message-ID: <20110529071948.GA20686@elte.hu> References: <1306436223.3065.36.camel@lappy> <20110526230923.GB15983@Krystal> <1306491547.3217.9.camel@lappy> <20110527103657.GA25748@elte.hu> <1306511560.3217.23.camel@lappy> <20110527171040.GC4356@elte.hu> <1306527578.3217.26.camel@lappy> <20110528152408.GA27104@elte.hu> <1306611908.3282.7.camel@lappy> <4DE1EC05.3040001@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , Mathieu Desnoyers , Pekka Enberg , john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, "Paul E. McKenney" To: Avi Kivity Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:36946 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267Ab1E2HUE (ORCPT ); Sun, 29 May 2011 03:20:04 -0400 Content-Disposition: inline In-Reply-To: <4DE1EC05.3040001@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Avi Kivity wrote: > Yes, this is equivalent to the kernel's stop_machine_run(). It's a > heavyweight method but it should work just fine. Yeah. It is fine for reconfiguration/configuration-only kind of write paths - i.e. the mmio lookup path should be ok. There's only one thing i'd like to warn about: please still shape it as a br_read_lock()/unlock(), br_write_lock()/unlock() operation. This way all the SMP read paths remain identified properly, even if br_write_lock() does a stop_machine_run() equivalent. This still leaves options open for an easy conversion to rwlock or urcu (should any particular write path become more than just occasional). Thanks, Ingo