From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by dpdk.org (Postfix) with ESMTP id 62A81AE99 for ; Tue, 15 Apr 2014 15:51:06 +0200 (CEST) Received: by mail-we0-f173.google.com with SMTP id w61so9643547wes.32 for ; Tue, 15 Apr 2014 06:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UuelAKqVB+95DW2WXYGX+rG2wr15FU8dgpCEo7qdu7k=; b=GgC/KQOgDCADVFFB2BzhwB3KD5/keebnOOsAN86DmfZDYdtv7MHOTbafAaQepCNFJ3 UAIB7MNxQRbd2/U/AahgyDxjnfzcxSM3BBKRgCB2xjLQZeLbiNuXIAE9/9cXClkacL7s DTPXjKC0xNtGlWIMEy8knKSOlGlTERJvBnlIYowvZp9hwCIaOu72A4GX7Vbz+ZqqJGVP PfUjOy6OuAqr0XPB25rvbFZcyN9aBWCHpwgWpzGAOPoj/HnYIyObOcd+y/s/Bs8I70KU YjTsCZwbHMqpDtjfMzQWnO5K4yTbKclJSW7dl6Vk5rwJxmqNn6tONZL6cSNYiCfiQjGA 90cQ== X-Gm-Message-State: ALoCoQkhIiG/JmNGGzosl9jzLN7RMTpe0HrgYz9PgMwQWzq6snFQy1mntX/OJWlBLqD4MUnMY2We X-Received: by 10.194.191.195 with SMTP id ha3mr1671082wjc.69.1397569866820; Tue, 15 Apr 2014 06:51:06 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id co9sm29827177wjb.22.2014.04.15.06.51.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 06:51:06 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 15 Apr 2014 15:50:58 +0200 Message-Id: <1397569859-14460-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH 1/2] mem: add write memory barrier before changing heap state 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: Tue, 15 Apr 2014 13:51:06 -0000 From: Didier Pallard a write memory barrier is needed before changing heap state value, else some concurrent core may see state changing before all initialization values are written to memory, causing unpredictable results in malloc function. Signed-off-by: Didier Pallard --- lib/librte_malloc/malloc_heap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_malloc/malloc_heap.c b/lib/librte_malloc/malloc_heap.c index f4a0294..64668cb 100644 --- a/lib/librte_malloc/malloc_heap.c +++ b/lib/librte_malloc/malloc_heap.c @@ -147,6 +147,7 @@ malloc_heap_init(struct malloc_heap *heap) */ heap->numa_socket = heap - mcfg->malloc_heaps; rte_spinlock_init(&heap->lock); + rte_wmb(); heap->initialised = INITIALISED; } } -- 1.7.10.4