From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] mbuf: fix atomic refcnt update synchronization Date: Fri, 2 Sep 2016 09:51:43 -0700 Message-ID: <20160902095143.117482f0@xeon-e3> References: <1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com> <20160902091236.57250d1a@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Linzhe Lee Return-path: Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by dpdk.org (Postfix) with ESMTP id 63C3A2931 for ; Fri, 2 Sep 2016 18:51:33 +0200 (CEST) Received: by mail-pf0-f180.google.com with SMTP id p64so44059174pfb.1 for ; Fri, 02 Sep 2016 09:51:33 -0700 (PDT) In-Reply-To: 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" On Sat, 3 Sep 2016 00:31:50 +0800 Linzhe Lee wrote: > Thanks for reply, Stephen. > > > > I'm in x86-64, my cpu is `Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz`. > > > > When allocation mbuf in program1, and transfer it to program2 for free > via ring, the program1 might meet assert in allocate mbuf sometimes. > (`RTE_ASSERT(rte_mbuf_refcnt_read(m) == 0);`) > > > > but when I using gdb to check it, the refcnt field of mbuf is already > zero. so I believe the problem came from the cache line problem or > incorrect optimization. > > > > When apply this patch, the problem seems solved. I'm submitting it for > your comments. Are you sure you have REFCNT_ATOMIC set?