From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VONkE-000189-6x for qemu-devel@nongnu.org; Tue, 24 Sep 2013 04:13:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VONk9-0002X7-Dt for qemu-devel@nongnu.org; Tue, 24 Sep 2013 04:13:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VONk9-0002Wu-5X for qemu-devel@nongnu.org; Tue, 24 Sep 2013 04:13:13 -0400 Message-ID: <524149A0.8040002@redhat.com> Date: Tue, 24 Sep 2013 10:13:20 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1379837479-8419-1-git-send-email-pingfank@linux.vnet.ibm.com> <1379837479-8419-2-git-send-email-pingfank@linux.vnet.ibm.com> <523FDDCD.6050407@siemens.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/4] seqlock: introduce read-write seqlock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: Alex Bligh , Jan Kiszka , Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi Il 24/09/2013 07:33, liu ping fan ha scritto: > On Mon, Sep 23, 2013 at 2:21 PM, Jan Kiszka wrote: >> On 2013-09-22 10:11, Liu Ping Fan wrote: >>> This lets the read-side access run outside the BQL. >> >> In fact, not only BQL. Didn't the original commit provide a changlog >> about the content of this patch? Otherwise, briefly describe use cases >> and maybe the typical invocation pattern. >> > Original commit provide no changelog (right? Paolo, if I do miss the > latest one in your tree). Indeed I had never written one. > What about the commit log like: > > Seqlock implementation for QEMU. Usage idiom > reader: > seqlock_read_begin() > do{ > }while(seqlock_read_try()) > > writer: > seqlock_write_lock() > ... > seqlock_write_unlock() > > initialization: > seqlock_init(QemuSeqLock *sl, QemuMutex *mutex) > where mutex could be NULL if the caller has provided extra lock > protection for seqlock_write_lock. replace "has provided" with "will provide". Otherwise looks good. Paolo