From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO4OP-0002WU-H6 for qemu-devel@nongnu.org; Wed, 18 Feb 2015 08:10:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO4OK-0008AS-N7 for qemu-devel@nongnu.org; Wed, 18 Feb 2015 08:10:17 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:49509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO4OK-0008AH-FP for qemu-devel@nongnu.org; Wed, 18 Feb 2015 08:10:12 -0500 Received: by mail-wi0-f175.google.com with SMTP id r20so40929183wiv.2 for ; Wed, 18 Feb 2015 05:10:12 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54E48F2F.7040601@redhat.com> Date: Wed, 18 Feb 2015 14:10:07 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150218115534.4176.12578.stgit@PASHA-ISP> <20150218115710.4176.28907.stgit@PASHA-ISP> In-Reply-To: <20150218115710.4176.28907.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v9 15/23] aio: replace stack of bottom halves with queue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, afaerber@suse.de, fred.konrad@greensocs.com On 18/02/2015 12:57, Pavel Dovgalyuk wrote: > +#define QSIMPLEQ_INSERT_TAIL_RCU(head, elm, field) do { \ > + (elm)->field.sqe_next = NULL; \ Also, smp_wmb() goes here. My fault: in the previous review I wrote "smp_wmb() must be after the (elm) assignment". I meant after the assignment of elm's fields (i.e. write elm's fields before publishing it) but it wasn't clear at all. Even better, you can replace the following two lines with: atomic_rcu_set((head)->sqh_last, (elm)); Paolo > + *(head)->sqh_last = (elm); \ > + smp_wmb(); \ > + (head)->sqh_last = &(elm)->field.sqe_next; \ > +} while (/*CONSTCOND*/0) > +