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 953262BB4 for ; Wed, 9 Mar 2016 15:53:09 +0100 (CET) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1adfVY-0005y4-Bf; Wed, 09 Mar 2016 15:54:40 +0100 To: "Venkatesan, Venky" , "Hunt, David" , "dev@dpdk.org" References: <1453829155-1366-1-git-send-email-david.hunt@intel.com> <1455634095-4183-1-git-send-email-david.hunt@intel.com> <1455634095-4183-3-git-send-email-david.hunt@intel.com> <56C71919.50506@6wind.com> <1FD9B82B8BF2CF418D9A1000154491D97EC6711B@ORSMSX102.amr.corp.intel.com> From: Olivier MATZ Message-ID: <56E038CD.3000909@6wind.com> Date: Wed, 9 Mar 2016 15:53:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1FD9B82B8BF2CF418D9A1000154491D97EC6711B@ORSMSX102.amr.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/6] mempool: add stack (lifo) based external mempool handler 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: Wed, 09 Mar 2016 14:53:09 -0000 Hi, >> Hi David, >> >> On 02/16/2016 03:48 PM, David Hunt wrote: >>> adds a simple stack based mempool handler >>> >>> Signed-off-by: David Hunt >>> --- >>> lib/librte_mempool/Makefile | 2 +- >>> lib/librte_mempool/rte_mempool.c | 4 +- >>> lib/librte_mempool/rte_mempool.h | 1 + >>> lib/librte_mempool/rte_mempool_stack.c | 164 >>> +++++++++++++++++++++++++++++++++ >>> 4 files changed, 169 insertions(+), 2 deletions(-) create mode >>> 100644 lib/librte_mempool/rte_mempool_stack.c >>> >> >> I don't get what is the purpose of this handler. Is it an example or is it >> something that could be useful for dpdk applications? >> > This is actually something that is useful for pipelining apps, > where the mempool cache doesn't really work - example, where we > have one core doing rx (and alloc), and another core doing > Tx (and return). In such a case, the mempool ring simply cycles > through all the mbufs, resulting in a LLC miss on every mbuf > allocated when the number of mbufs is large. A stack recycles > buffers more effectively in this case. > While I agree on the principle, if this is the case the commit should come with an explanation about when this handler should be used, a small test report showing the performance numbers and probably an example app. Also, I think there is a some room for optimizations, especially I don't think that the spinlock will scale with many cores. Regards, Olivier