From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 4E6DA2BA1 for ; Fri, 25 Mar 2016 12:15:25 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id p65so22241746wmp.1 for ; Fri, 25 Mar 2016 04:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=rzuVBiw+i3pb07KABcQlAome4a/JspnEDcFwWiTdGgA=; b=sRVh5AloINGeizXP+JyBHFH90sG9bCVIfXHHCHwoP/y3QSFT4g33w3VBKXRiNlj+F7 dysxGfklM25tG9NsIB/y/PdcQBhi/xXKI5KB77Qdrjo+QofbWqGhQfHmg1LCra88q6Lo ab48kdlaiofhJtJjfczd7ZvIUSpnfxs0oRwABNNe034sM0tBhPVXxRVlNTayQB+tQ6u0 9biLaj6YTBsfTcLgGd2et63+wTjRcZ9DUdI60yyUMRE96D5vnY9tFLM65Ri786/896wH n6IM+xjIp3nqyQTGyfDbVQ0BWlc2vZiTUwuZeznaHnBdz82RyDuL4A2BwFgjbkCSNpkk HmLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=rzuVBiw+i3pb07KABcQlAome4a/JspnEDcFwWiTdGgA=; b=G4aZJXp3EzwAgXVA/6po5o+Mkl7caVwO6llBUoVnUBpB3dviC883NBczLNhELVNHiV iCwul/k5mvGUn8Y55cJn6ByfSE4nkqyiJ51km+NJoslnCsnKYKz1wCYbzr4TTfuN6GQ5 XIScRIOap1yVYdffKPYCm6BbUh/tDYvlBMepiNpmO4ncjX6un7voWPtmDLimjCz/9Yg7 sdfa1DeVxWI6OT3flOZKN+LSgF8VmUAAhRYH8KBHUDJ4IIc8BK/UCuyK7xlEx2eU8SSZ ymQ59nfTyGWqEi5wL0uy5Pq4YoYAo9MUNdfpUr6yQ/pE9EmykdgFI1Vux6dC75SGWtZW F6XA== X-Gm-Message-State: AD7BkJLvu0bEsa1sjTYv2DWp9FbkTpXNsjn5QEqQ926xRkWZtSPmwIRscnPoylDKDB8Ch7tI X-Received: by 10.28.11.131 with SMTP id 125mr39217574wml.58.1458904525186; Fri, 25 Mar 2016 04:15:25 -0700 (PDT) Received: from [192.168.0.10] (was59-1-82-226-113-214.fbx.proxad.net. [82.226.113.214]) by smtp.gmail.com with ESMTPSA id t82sm2676350wmt.17.2016.03.25.04.15.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 04:15:24 -0700 (PDT) To: Lazaros Koromilas , dev@dpdk.org References: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> Cc: Thomas Monjalon From: Olivier Matz X-Enigmail-Draft-Status: N1110 Message-ID: <56F51DCB.5020502@6wind.com> Date: Fri, 25 Mar 2016 12:15:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] ring: check for zero objects mc dequeue / mp enqueue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 11:15:25 -0000 Hi Lazaros, 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. Just a question about this patch (that has been applied). Thomas retitled the commit from your log message: ring: fix deadlock in zero object multi enqueue or dequeue http://dpdk.org/browse/dpdk/commit/?id=d0979646166e I think this patch does not fix a deadlock, or did I miss something? As explained in the following links, the ring may not perform well if several threads running on the same cpu use it: http://dpdk.org/ml/archives/dev/2013-November/000714.html http://www.dpdk.org/ml/archives/dev/2014-January/001070.html http://www.dpdk.org/ml/archives/dev/2014-January/001162.html http://dpdk.org/ml/archives/dev/2015-July/020659.html A deadlock could occur if the threads running on the same core have different priority. Regards, Olivier