From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 7542F5323 for ; Thu, 11 Aug 2016 09:05:27 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id i5so13832804wmg.0 for ; Thu, 11 Aug 2016 00:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=By0zlqW2RzVQIA5gehfi8XbZZQHTtcEjrpPCvC/iYeM=; b=BlciHyg1S1fK+B9EZQ0dfDSTH3zN+exqAI2GnDEW5ew75U3HK1xbLEk5tBKeORr7V6 cIkaGgEi6CCkCxK5qaao2+I0He78SRoz9z2rGjzAdOxQ6j/aCPfZ4+nAuchaYeGZSBKg bhf32mzFQepoXnVqtbhCrZsAXdVVL52PXSPtU09CteMUqKHgYZjOascsHlMkExivFwJ5 Nu8CEi8wVDSzEPN4vglnAgaAx5PycMjbyA5jiBEtfxC1gvmU5ESiG8GLMsoxLLOUQILh Q+fpSbrZT++fv+RrUQBxSS5tslkMAG+MTYob9cvOGKccZtpe3fe+lrRd+pWR7oiC3Up/ nXBA== 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:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=By0zlqW2RzVQIA5gehfi8XbZZQHTtcEjrpPCvC/iYeM=; b=H/8NNKoA/4XQ8Pjp9ZMiJwAl8MJgd8XRZXYv9NxNHwLiOQdKaVGENxin+nzionQCRT IhNZphj+MQX0uTLigsrWzCGnLgUHb838z4cYM4sudLdr9vsJbL9iyB/7BxWPWHYRqvOt Dcrp1fj5lSOfz0Ke7A/O1IH7gN4wIp84KNSR31dNEIYjkubAKGYwTV0GF11H4yYO/BN+ Q/ISeK2jcicdHyYPdp4C25i6SbXMxQCYZ+ajAMBlcY5mldbQxWSWCKxZjqwomCVZlixw lXjs9foWRXD9hx5b/1e20nItsGIuiGVPysmrUcr2GdEyIX1wU9HflSXhKUBGBVRy6m81 62jA== X-Gm-Message-State: AEkoouvxyrw+X4DW/gx0ORmqxoI7RDmhF/yjbmxrbu+1MFcQxvBKTvveE0I6mgp35fdVZ3el X-Received: by 10.194.97.73 with SMTP id dy9mr7898474wjb.132.1470899127235; Thu, 11 Aug 2016 00:05:27 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id k186sm11885274wmd.13.2016.08.11.00.05.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 00:05:26 -0700 (PDT) From: Thomas Monjalon To: users@dpdk.org, dev@dpdk.org, "Gonzalez Monroy, Sergio" , bruce.richardson@intel.com Cc: "Verkamp, Daniel" Date: Thu, 11 Aug 2016 09:05:25 +0200 Message-ID: <1549431.MJntLMElOg@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1470871839.40000.48.camel@intel.com> References: <1470871839.40000.48.camel@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 07:05:27 -0000 Hi, 2016-08-10 23:30, Verkamp, Daniel: > It seems that with DPDK 16.07, rte_zmalloc() and related functions no > longer return zeroed memory reliably on FreeBSD. > > I notice that commit b78c9175118f7d61022ddc5c62ce54a1bd73cea5 ("mem: do > not zero out memory on zmalloc") removed the explicit memset() that used > to ensure the buffer was zeroed; its log message says: > > "Zeroing out memory on rte_zmalloc_socket is not required anymore since > all allocated memory is already zeroed." On Linux, the memory is zeroed by the kernel. Then the zero value is maintained in the rte_malloc pool by rte_free. > However, I don't see how this is guaranteed (at least for FreeBSD), and > it is not true in practice. I've attached a minimized reproducer program - > running it twice in a row fails reliably for me. > > Is there a missing step in FreeBSD, or is it a more general problem for > other platforms? I guess the initial value from the kernel has been verified only on Linux. We could re-add a memset for FreeBSD.