From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlkZJ-00076o-C1 for qemu-devel@nongnu.org; Fri, 13 Jan 2012 12:05:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlkZH-0003Pw-4G for qemu-devel@nongnu.org; Fri, 13 Jan 2012 12:05:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlkZG-0003PE-Ss for qemu-devel@nongnu.org; Fri, 13 Jan 2012 12:05:31 -0500 Message-ID: <4F106457.3040208@redhat.com> Date: Fri, 13 Jan 2012 18:05:27 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1326472445-25966-1-git-send-email-pbonzini@redhat.com> <1326472445-25966-4-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/5] qemu-queue: drop QCIRCLEQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On 01/13/2012 05:44 PM, Peter Maydell wrote: >> The main advantage of circular lists (the fact that the head node >> > has the same memory layout as any other node) is completely negated >> > by the implementation in qemu-queue.h. Not surprisingly, nobody >> > uses QCIRCLEQ. While this might change if RCU is ever adopted by >> > QEMU, the QLIST is also RCU-friendly and in fact it is used in a >> > RCU-like manner by 9pfs already. So, just kill QCIRCLEQ. > Kirk McKusick on why CIRCLEQ existed in the first place and > why BSD still has it: > http://markmail.org/message/i5oir4jhmkopjzy5 > ...basically just legacy back-compat. So it's fine for us to drop > it from QEMU, since we have nothing to be back-compat with. Thanks for posting this. I think it's not entirely correct because the cast in QTAILQ_PREV and QTAILQ_FOREACH_REVERSE does not look like valid ANSI C. No matter how hard I look I admit I cannot figure out how it works, but anyway I suspect it can be changed to ANSI C using typeof if one was bitten by it. So removing QCIRCLEQ is not a bad idea anyway. BTW, NetBSD also has some STAILQ which looks entirely the same as SIMPLEQ. Paolo