From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 344D410A3 for ; Wed, 18 Jul 2018 19:18:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2018 10:18:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,371,1526367600"; d="scan'208";a="65649439" Received: from akkaladi-mobl.gar.corp.intel.com (HELO [10.252.69.169]) ([10.252.69.169]) by FMSMGA003.fm.intel.com with ESMTP; 18 Jul 2018 10:18:42 -0700 To: Andrew Rybchenko Cc: "dev@dpdk.org" , Sergio Gonzalez Monroy References: <8bc76811-ac29-d7f2-e4c3-12b50fd44dba@solarflare.com> From: "Burakov, Anatoly" Message-ID: <58e5044c-3d13-9171-4168-b4d6b1d61927@intel.com> Date: Wed, 18 Jul 2018 18:18:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8bc76811-ac29-d7f2-e4c3-12b50fd44dba@solarflare.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Memory allocated using rte_zmalloc() has non-zeros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 17:18:47 -0000 On 18-Jul-18 4:20 PM, Andrew Rybchenko wrote: > Hi Anatoly, > > I'm investigating issue which finally comes to the fact that memory > allocated using > rte_zmalloc() has non zeros. > > If I add memset just after allocation, everything is perfect and works > fine. > > I've found out that memset was removed from rte_zmalloc_socket() some > time ago: > > >>> > commit b78c9175118f7d61022ddc5c62ce54a1bd73cea5 > Author: Sergio Gonzalez Monroy > Date:   Tue Jul 5 12:01:16 2016 +0100 > >     mem: do not zero out memory on zmalloc > >     Zeroing out memory on rte_zmalloc_socket is not required anymore > since all >     allocated memory is already zeroed. > >     Signed-off-by: Sergio Gonzalez Monroy > > <<< > > but may be something has changed now that made above statement false. > > I observe the problem when memory is reallocated. I.e. I configure 7 > queues, > start, stop, reconfigure to 3 queues, start. Memory is allocated on > start and > freed on stop, since we have less queues on the second start it is > allocated > in a different way and reuses previously allocated/freed memory. > > Do you have any ideas what could be wrong? > > Andrew. > > Hi Andrew, I will look into it first thing tomorrow. In general, we memset(0) on free, and kernel gives us zeroed out pages initially, so the most likely point of failure is that i'm not overwring some malloc headers correctly on free. -- Thanks, Anatoly