From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=3Oiq3uDPnqJ7ewcvvH0tLIVAq0Tee/wxzrPEPYwJQCU=; b=gciVITouquz06Dvr4vgVfRW24WyK69mkzymaziuAr3bugbhkQG7GYQAcDaR8+DNlmD GZHclBvQghsWu/QpNW0tijVTdC3KFAujKjg+U7C37TGMIGo1DW/rX29ZbjniIS/P0/r+ fb+JTHNaMcNoVNx5OV50a2qWR0qbwlj3hIrbMlB584aSvEeD3Lpeimfi20W6X8MUH0y4 G9gw20uFJxyHsKcgOGD5etyFQGhc6JHJ4Zz9gnJp3Ow3U6+sPRrorecxS4J4PVLCxtej Uqo8t6fJE93ZNlLXzZVDVd0R7HMoKK3ZhsmQwgrrYMXbDslBGdK1xkqBHLEsLDZkYzBc Gu+g== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=3Oiq3uDPnqJ7ewcvvH0tLIVAq0Tee/wxzrPEPYwJQCU=; b=T1BYKhq8I7imk4aovqPYb9S94Pp4bE8JFwuCGBRbzr18b+aBB2w904kuF8AAl9bhUl tx8MYIeMv7KWXytsHv+ulI7dLWh4jPTjzedrWteQ6v+5nIEnKxS/utelJvnAkYze3X5W BNR228p3K0Khi3d785NCJY4TemNyq09u0fHWLwJotSHIGpYhQRHd9vAdY4K+QheSSGDS PJLfp9BkP7C5DpVa1l4NOtrwsRArrm3NnQwz9z3ADsR1CAHFYXHhWG87jHmlQ9xfEcpZ 8zghDJR6SK5vFMDNOiDLJrW41gnt1kTtpRrEJFP/PymyDnrM91hp7z/aWcxQD//EkI8U 98Pw== X-Gm-Message-State: AD7BkJIpzwPMcK+cymNs0fODeiSLPczeq75JH9xiCCFzqoOECOxyWwHTqQZvZs6iGcXV4Qkq X-Received: by 10.28.214.6 with SMTP id n6mr13987873wmg.49.1458563024257; Mon, 21 Mar 2016 05:23:44 -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 n66sm12291413wmg.20.2016.03.21.05.23.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2016 05:23:43 -0700 (PDT) To: Lazaros Koromilas , dev@dpdk.org References: <1458229783-15547-1-git-send-email-l@nofutznetworks.com> From: Olivier Matz Message-ID: <56EFE7CE.9010804@6wind.com> Date: Mon, 21 Mar 2016 13:23:42 +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: Mon, 21 Mar 2016 12:23:44 -0000 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