From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH v2 6/8] kvm tools: Add rwlock wrapper Date: Mon, 30 May 2011 12:46:36 +0300 Message-ID: <1306748796.14564.62.camel@lappy> References: <1306744247-26051-1-git-send-email-levinsasha928@gmail.com> <1306744247-26051-6-git-send-email-levinsasha928@gmail.com> <20110530084309.GH30513@elte.hu> <1306748069.14564.52.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Ingo Molnar , kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, "Paul E. McKenney" To: Pekka Enberg Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:55409 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755105Ab1E3JrG (ORCPT ); Mon, 30 May 2011 05:47:06 -0400 Received: by fxm17 with SMTP id 17so2349457fxm.19 for ; Mon, 30 May 2011 02:47:05 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2011-05-30 at 12:40 +0300, Pekka Enberg wrote: > Hi Sasha, > > On Mon, May 30, 2011 at 12:34 PM, Sasha Levin wrote: > > It would mean we need that many VCPUs: current br_read_lock() doesn't > > really do anything, which means that running these tests with dummy > > threads won't work. > > Heh, sure they're doing something - they're burning CPU. You assume > that br_write_unlock() will actually resume all of them but I'd really > like to see a reproducible test case for that. ;-) I agree with what you're saying: testing whether br_write_lock() makes all VCPU threads stop and br_write_unlock() makes all VCPU threads resume should be tested. I'm just saying that we're limited to as many VCPU threads as we can create. br_read_lock() won't do anything on a non-VCPU thread, which makes it impossible to test it on non-VCPUs. > Do you think it's a bad idea? I don't quite see why - as I've said > before, this is something we learned the hard way when we implemented > our own locking primitives and stop-the-world for Jato. Those are just > so damn easy to break accidentally so having some safety net is > definitely worth it. > > Also, didn't Paul suggest some debugging magic to detect errors? > > Pekka -- Sasha.