From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH v2] ring: check for zero objects mc dequeue / mp enqueue Date: Mon, 21 Mar 2016 13:23:42 +0100 Message-ID: <56EFE7CE.9010804@6wind.com> References: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Lazaros Koromilas , dev@dpdk.org Return-path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 54F912C40 for ; Mon, 21 Mar 2016 13:23:44 +0100 (CET) Received: by mail-wm0-f46.google.com with SMTP id l68so107729960wml.0 for ; Mon, 21 Mar 2016 05:23:44 -0700 (PDT) In-Reply-To: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, On 03/17/2016 04:49 PM, Lazaros Koromilas wrote: > Issuing a zero objects dequeue with a single consumer has no effect. > Doing so with multiple consumers, can get more than one thread to succeed > the compare-and-set operation and observe starvation or even deadlock in > the while loop that checks for preceding dequeues. The problematic piece > of code when n = 0: > > cons_next = cons_head + n; > success = rte_atomic32_cmpset(&r->cons.head, cons_head, cons_next); > > The same is possible on the enqueue path. > > Signed-off-by: Lazaros Koromilas Acked-by: Olivier Matz