From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 0E6E51B040 for ; Mon, 19 Mar 2018 18:49:31 +0100 (CET) Received: from lfbn-lil-1-702-109.w81-254.abo.wanadoo.fr ([81.254.39.109] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1exyv2-0007Bo-Ue; Mon, 19 Mar 2018 18:50:02 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Mon, 19 Mar 2018 18:49:27 +0100 Date: Mon, 19 Mar 2018 18:49:27 +0100 From: Olivier Matz To: Anatoly Burakov Cc: dev@dpdk.org, keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com, benjamin.walker@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, konstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com Message-ID: <20180319174927.6hrfh663c3k6u4h4@platinum> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 18/41] test: fix malloc autotest to support memory hotplug 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: Mon, 19 Mar 2018 17:49:31 -0000 On Sat, Mar 03, 2018 at 01:46:06PM +0000, Anatoly Burakov wrote: > The test was expecting memory already being allocated on all sockets, > and thus was failing because calling rte_malloc could trigger memory > hotplug event and allocate memory where there was none before. > > Fix it to instead report availability of memory on specific sockets > by attempting to allocate a page and see if that succeeds. Technically, > this can still cause failure as memory might not be available at the > time of check, but become available by the time the test is run, but > this is a corner case not worth considering. > > Signed-off-by: Anatoly Burakov > --- > test/test/test_malloc.c | 52 +++++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 44 insertions(+), 8 deletions(-) > > diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c > index 8484fb6..2aaf1b8 100644 > --- a/test/test/test_malloc.c > +++ b/test/test/test_malloc.c > @@ -22,6 +22,8 @@ > #include > #include > > +#include "../../lib/librte_eal/common/eal_memalloc.h" > + I guess there is no way to test without importing a private EAL function, correct? If yes, maybe it deserves a quick explanation.