From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 7188C2C31 for ; Thu, 11 Aug 2016 09:05:27 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id o80so13796375wme.1 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=hj00OHLwviLMyiuso0Jig2/9uQXf/ZfLuO0qn/OwRcf6uoQyEAe65vS5OGyGnXrvgA 3XFof5iWnWwOL1lJhQbB6tEU3G/tseGYlrqbww7YkXGmhndsiQUb4yR+A7WJfsUg4ags ieQxCNVrFBbFkkYaNw0lp/oTq0d5NvqbfzVuzYlBRPQC+yKG9RcqaHU0oXkuwOyHGgNU 2dMB34+sRsjs1PIenAa5s8jhEZq9KhCeuVIuHvhp7ybeswAMnJb/pvu7R++B6cBtzNWB tsJUau9Mt7V4Yo85FR5oF5JXeCJjxac3pJRYLkqBggP89A2ZfJKUNK8tLPFxIdB25OCJ Pmjw== X-Gm-Message-State: AEkoouvDciHluLeuJaCsmu+scGKsIix9rNdW/vu3YjbPt2Q9xy33uIExY5iNubz2T6mlowjm 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-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD 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: 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.