From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 2/2] malloc: avoid padding elements on page deallocation Date: Wed, 02 May 2018 18:28:03 +0200 Message-ID: <2387384.z8u5O1jZH9@xps> References: <454d2b8eea6615a20e496fa924cc04feda9bb686.1525274971.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, shahafs@mellanox.com, olgas@mellanox.com, rasland@mellanox.com To: Anatoly Burakov Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 0E2B21E35 for ; Wed, 2 May 2018 18:28:06 +0200 (CEST) In-Reply-To: <454d2b8eea6615a20e496fa924cc04feda9bb686.1525274971.git.anatoly.burakov@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 02/05/2018 17:38, Anatoly Burakov: > Currently, when deallocating pages, malloc will fixup other > elements' headers if there is not enough space to store a full > element in leftover space. This leads to race conditions because > there are some functions that check for pad size with an unlocked > heap, expecting pad size to be constant. > > Fix it by being more conservative and only freeing pages when > there is enough space before and after the page to store a free > element. > > Fixes: 1403f87d4fb8 ("malloc: enable memory hotplug support") > Cc: anatoly.burakov@intel.com > > Signed-off-by: Anatoly Burakov Series applied, thanks. (typo fixed and added uppercase at beginning of sentences)