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:12:36 -0700 Message-ID: <20160902091236.57250d1a@xeon-e3> References: <1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, =?UTF-8?B?5p2O5p6X5ZOy?= To: lilinzhe Return-path: Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id 5F8292BB3 for ; Fri, 2 Sep 2016 18:12:27 +0200 (CEST) Received: by mail-pf0-f181.google.com with SMTP id x72so43712098pfd.2 for ; Fri, 02 Sep 2016 09:12:27 -0700 (PDT) In-Reply-To: <1472793906-5699-1-git-send-email-slayercat.subscription@gmail.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" On Fri, 2 Sep 2016 13:25:06 +0800 lilinzhe wrote: > From: =E6=9D=8E=E6=9E=97=E5=93=B2 >=20 > chagne atomic ref update to always call atomic_add >=20 > when mbuf is allocated by cpu1 and freed by cpu2. cpu1 cache may not be u= pdated by such a set operation. > causes refcnt reads incorrect values. What architecture are you dealing with? On X86 memory is cache coherent. Doing atomic operation all the time on each mbuf free would significantly slow down performance.