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 53FBF9A9A for ; Mon, 20 Jun 2016 10:17:44 +0200 (CEST) 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_2) (envelope-from ) id 1bEuRB-0007uv-91; Mon, 20 Jun 2016 10:20:05 +0200 To: "Hunt, David" , dev@dpdk.org References: <1462472982-49782-1-git-send-email-david.hunt@intel.com> <1463669335-30378-1-git-send-email-david.hunt@intel.com> <1463669335-30378-2-git-send-email-david.hunt@intel.com> <5742FDA6.5070108@6wind.com> <576406B2.5060605@intel.com> From: Olivier Matz Message-ID: <5767A6A0.8000800@6wind.com> Date: Mon, 20 Jun 2016 10:17:36 +0200 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: <576406B2.5060605@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/3] mempool: add stack (lifo) 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: Mon, 20 Jun 2016 08:17:44 -0000 Hi David, On 06/17/2016 04:18 PM, Hunt, David wrote: >> After reading it, I realize that it's nearly exactly the same code than >> in "app/test: test external mempool handler". >> http://patchwork.dpdk.org/dev/patchwork/patch/12896/ >> >> We should drop one of them. If this stack handler is really useful for >> a performance use-case, it could go in librte_mempool. At the first >> read, the code looks like a demo example : it uses a simple spinlock for >> concurrent accesses to the common pool. Maybe the mempool cache hides >> this cost, in this case we could also consider removing the use of the >> rte_ring. > > While I agree that the code is similar, the handler in the test is a > ring based handler, > where as this patch adds an array based handler. Not sure I'm getting what you are saying. Do you mean stack instead of array? Actually, both are stacks when talking about bulks of objects. If we consider each objects one by one, that's true the order will differ. But as discussed in [1], the cache code already reverses the order of objects when doing a mempool_get(). I'd say the reversing in cache code is not really needed (only the order of object bulks should remain the same). A rte_memcpy() looks to be faster, but it would require to do some real-life tests to validate or unvalidate this theory. So to conclude, I still think both code in app/test and lib/mempool are quite similar, and only one of them should be kept. [1] http://www.dpdk.org/ml/archives/dev/2016-May/039873.html > I think that the case for leaving it in as a test for the standard > handler as part of the > previous mempool handler is valid, but maybe there is a case for > removing it if > we add the stack handler. Maybe a future patch? > >> Do you have some some performance numbers? Do you know if it scales >> with the number of cores? > > For the mempool_perf_autotest, I'm seeing a 30% increase in performance > for the > local cache use-case for 1 - 36 cores (results vary within those tests > between > 10-45% gain, but with an average of 30% gain over all the tests.). > > However, for the tests with no local cache configured, throughput of the > enqueue/dequeue > drops by about 30%, with the 36 core yelding the largest drop of 40%. So > this handler would > not be recommended in no-cache applications. Interesting, thanks. If you also have real-life (I mean network) performance tests, I'd be interested too. Ideally, we should have a documentation explaining in which cases a handler or another should be used. However, if we don't know this today, I'm not opposed to add this new handler in 16.07, and let people do their tests and comment, then describe it properly for 16.11. What do you think? Regards, Olivier