From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBiNA-0000JW-HT for qemu-devel@nongnu.org; Thu, 15 Jan 2015 06:13:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBiN5-0005XI-Te for qemu-devel@nongnu.org; Thu, 15 Jan 2015 06:13:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBiIJ-00048Y-3x for qemu-devel@nongnu.org; Thu, 15 Jan 2015 06:08:55 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0FB8sOK023642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Jan 2015 06:08:54 -0500 Message-ID: <54B79FC1.6040904@redhat.com> Date: Thu, 15 Jan 2015 12:08:49 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1421171537-19118-1-git-send-email-pbonzini@redhat.com> <1421171537-19118-3-git-send-email-pbonzini@redhat.com> <20150115103948.GA1587@ad.nay.redhat.com> In-Reply-To: <20150115103948.GA1587@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/8] rcu: add rcu library List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, stefanha@redhat.com On 15/01/2015 11:39, Fam Zheng wrote: >> +How is this possible? The basic idea is to split updates in two phases, >> +"removal" and "reclamation". During removal, we ensure that subsequent >> +readers will not be able to get a reference to the old data. After >> +removal has completed, a critical section will not be able to access >> +the old data. Therefore, critical sections that begin after removal >> +do not matter; as soon as all previous critical sections have finished, >> +there cannot be any readers who hold references to the data structure, >> +which may not be safely reclaimed (e.g., freed or unref'ed). > > s/not/now/ ? Both are correct depending on how you read the sentence, but it is ambiguous. The idea was that "because of readers holding references, the data structures cannot be safely reclaimed". I will change the last line to "and these can now be safely reclaimed". The "and" puts the sentence in relationship with "as soon as all previous critical sections have finished", and "now" becomes unambiguously correct. >> +/* >> + * Global grace period counter. Bit 0 is always one in rcu_gp_ctr. >> + * Bits 1 and above are defined in synchronize_rcu/update_counter_and_wait. > > What is update_counter_and_wait? It's part of URCU and is now merged into synchronize_rcu. I'll fix the comment. Paolo