From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vZtjsNxJB9d8l3V6yzME6IsTHyFLDqrrrL3dcVYNpfI=; b=j/BovQBeyVxwydktT1WYsaFfQSgf/af0ExQyekT+Qv2t8+KH5PM7d2i3yrCYAsgYtq NhDZUUtbQdSDxeGEQhk51Yg2uphO4lL0qWtS7tZDxG2SCsP0EhdDH3w3ziS+7BuzoXJv RRBaA3EY6FWp5P9mZyYcC0MRhRAYKK8k7gcBDBpYuw1s4gxglJDU91+PzB/odJ6cr6FP mxNJvc1m23PlvLp96d+BOLWIy2oX5MVzdK8jssZZORHs92FYRrdYWFTyZcsiN47dreuU WiNohP1dK2IvR9ZHIWacAePYJ0iU02gQDciB9XRfWJrRxcmwTSJ6ZGU7TBZEt4wx2dNX kM/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vZtjsNxJB9d8l3V6yzME6IsTHyFLDqrrrL3dcVYNpfI=; b=hOaNqxJ1TByMf3oYzC1yZvHjAkIn00h+d08zLU4R1DajZCT3r8iDgfsPagL54wcyih KSTdGxsP3E8eLSDu8quXvfK8xElU551zpm0Tt8d6lOaWver63XP1mTXMVh8/wKV785yG +/JLxI9IkVuh4rVNGX09j4zKYI9BXvL29dU9M8rhxCnoelgSNWMhLKmcYOVpv2dynEnB IN0uUJeg6qmwqyEXqem2UlPdT0/ctWw9YOpXzaQ5K7oYtqIj5pklnV8bCzZfH8ZQwDVZ ip1YhNgIEGNiSrxgzzS0U07nqVMnkmjkk1/rbZUjwj867s49vpLNKKzlEMh0oTGZ9Ec2 DcdQ== X-Gm-Message-State: AE9vXwPYIin1kJQRZnUWwjdnEZYxh54RZbVDEzzPHw8fmKpVZRbWpHuutBF1wCSC1HYRFw== X-Received: by 10.98.72.28 with SMTP id v28mr37460422pfa.139.1472832746736; Fri, 02 Sep 2016 09:12:26 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id y184sm15861722pfg.94.2016.09.02.09.12.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Sep 2016 09:12:26 -0700 (PDT) Date: Fri, 2 Sep 2016 09:12:36 -0700 From: Stephen Hemminger To: lilinzhe Cc: dev@dpdk.org, =?UTF-8?B?5p2O5p6X5ZOy?= Message-ID: <20160902091236.57250d1a@xeon-e3> In-Reply-To: <1472793906-5699-1-git-send-email-slayercat.subscription@gmail.com> 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 Subject: Re: [dpdk-dev] [PATCH] mbuf: fix atomic refcnt update synchronization 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, 02 Sep 2016 16:12:27 -0000 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.