From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLVKe-0000oR-5O for qemu-devel@nongnu.org; Wed, 11 Feb 2015 06:19:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLVKX-0000R6-VC for qemu-devel@nongnu.org; Wed, 11 Feb 2015 06:19:48 -0500 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:33435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLVKX-0000R1-Ox for qemu-devel@nongnu.org; Wed, 11 Feb 2015 06:19:41 -0500 Received: by mail-we0-f176.google.com with SMTP id x3so2719850wes.7 for ; Wed, 11 Feb 2015 03:19:41 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54DB3AC8.80703@redhat.com> Date: Wed, 11 Feb 2015 12:19:36 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1423241728-21758-1-git-send-email-pbonzini@redhat.com> <1423241728-21758-10-git-send-email-pbonzini@redhat.com> <20150211084721.GD16164@ad.nay.redhat.com> In-Reply-To: <20150211084721.GD16164@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 9/9] Convert ram_list to RCU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Mike Day , qemu-devel@nongnu.org, stefanha@redhat.com On 11/02/2015 09:47, Fam Zheng wrote: >> > + rcu_read_lock(); >> > + block = atomic_rcu_read(&ram_list.mru_block); >> > if (block && block->host && host - block->host < block->max_length) { >> > goto found; >> > } >> > >> > - QLIST_FOREACH(block, &ram_list.blocks, next) { >> > + QLIST_FOREACH_RCU(block, &ram_list.blocks, next) { >> > /* This case append when the block is not mapped. */ >> > if (block->host == NULL) { >> > continue; > } > if (host - block->host < block->max_length) { > goto found; > } > } > //// > return NULL; > > Should we call rcu_read_unlock at "////"? Yes. Paolo