Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756881AbZFVSxa (ORCPT ); Mon, 22 Jun 2009 14:53:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751577AbZFVSxV (ORCPT ); Mon, 22 Jun 2009 14:53:21 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52682 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbZFVSxU (ORCPT ); Mon, 22 Jun 2009 14:53:20 -0400 Date: Mon, 22 Jun 2009 21:52:35 +0300 From: "Michael S. Tsirkin" To: Davide Libenzi Cc: Gregory Haskins , Gregory Haskins , kvm@vger.kernel.org, Linux Kernel Mailing List , avi@redhat.com, paulmck@linux.vnet.ibm.com, Ingo Molnar , Rusty Russell Subject: Re: [KVM PATCH v3 3/3] KVM: Fix races in irqfd using new eventfd_kref_get interface Message-ID: <20090622185235.GH15228@redhat.com> References: <20090622155504.22967.50532.stgit@dev.haskins.net> <20090622160556.22967.76273.stgit@dev.haskins.net> <20090622165708.GB15228@redhat.com> <4A3FBFF1.8050504@gmail.com> <20090622174506.GD15228@redhat.com> <20090622183222.GF15228@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 667 Lines: 15 On Mon, Jun 22, 2009 at 11:41:53AM -0700, Davide Libenzi wrote: > > Absolutely. But IMO documentation in the form of "fields A B C are > > protected by lock X" in a single place near field declaration is better > > than "we take lock X here to protect against race with user thread using > > fields A B C" sprinkled all over the code. > > Exactly what akpm suggested. Everything that can be invented has been invented. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/