From: Marcelo Tosatti Subject: Re: [RFC] make cpu creation happen inside the right thread. Date: Tue, 3 Nov 2009 15:46:07 -0200 Message-ID: <20091103174607.GB12390@amt.cnet> References: <1257258908-16541-1-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com, qemu-devel@nongnu.org, Jan Kiszka , Anthony Liguori To: Glauber Costa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62866 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753792AbZKCRqm (ORCPT ); Tue, 3 Nov 2009 12:46:42 -0500 Content-Disposition: inline In-Reply-To: <1257258908-16541-1-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Nov 03, 2009 at 12:35:08PM -0200, Glauber Costa wrote: > Right now, we issue cpu creation from the i/o thread, and then shoot a thread > from inside that code. Over the last months, a lot of subtle bugs were reported, > usually arising from the very fragile order of that initialization. > > I propose we rethink that a little. This is a patch that received basic testing > only, and I'd like to hear on the overall direction. The idea is to issue the new > thread as early as possible. The first direct benefits I can identify are that > we no longer have to rely at on_vcpu-like schemes for issuing vcpu ioctls, since > we are already on the right thread. Apic creation has far less spots for race > conditions as well. > > I am implementing this on qemu-kvm first, since we can show the benefits of it > a bit better in there (since we already support smp) > > Let me know what you guys think Makes sense to me. You still need on_vcpu for issuing vcpu ioctls though (after initialization).