From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gage Eads Subject: [PATCH v2 0/8] Add stack library and new mempool handler Date: Tue, 5 Mar 2019 10:42:48 -0600 Message-ID: <20190305164256.2367-1-gage.eads@intel.com> References: <20190222160655.3346-1-gage.eads@intel.com> Cc: olivier.matz@6wind.com, arybchenko@solarflare.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, gavin.hu@arm.com, Honnappa.Nagarahalli@arm.com, nd@arm.com, thomas@monjalon.net To: dev@dpdk.org Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1FD8A2BE9 for ; Tue, 5 Mar 2019 17:43:21 +0100 (CET) In-Reply-To: <20190222160655.3346-1-gage.eads@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" This patchset introduces a stack library, supporting both lock-based and lock-free stacks, and a lock-free stack mempool handler. The lock-based stack code is derived from the existing stack mempool handler, and that handler is refactored to use the stack library. The lock-free stack mempool handler is intended for usages where the rte ring's "non-preemptive" constraint is not acceptable; for example, if the application uses a mixture of pinned high-priority threads and multiplexed low-priority threads that share a mempool. Note that the lock-free algorithm relies on a 128-bit compare-and-swap[1], so it is currently limited to the x86_64 platform. This patchset is the successor to a patchset containing only the new mempool handler[2]. [1] http://mails.dpdk.org/archives/dev/2019-March/125751.html [2] http://mails.dpdk.org/archives/dev/2019-January/123555.html --- v2: - Reworked structure and function naming to use rte_stack_{std, lf}_... - Updated to the latest rte_atomic128_cmp_exchange() interface. - Rename STACK_F_NB -> RTE_STACK_F_LF. - Remove rte_rmb() and rte_wmb() from the generic push and pop implementations. These are obviated by rte_atomic128_cmp_exchange()'s two memorder arguments. - Edit stack_lib.rst text to 80 chars/line. - Fix rte_stack.h doxygen formatting. - Allocate popped_objs array from the heap - Fix stack_thread_push_pop bug ("&t->sz" -> "t->sz") - Remove unnecessary NULL check from test_stack_basic - Properly terminate the name string in test_stack_name_length - Add an empty array of struct rte_nb_lifo_elem elements - In rte_nb_lifo_push(), retrieve the last element from __nb_lifo_pop() - Split C11 implementation into a separate patchset Gage Eads (8): stack: introduce rte stack library mempool/stack: convert mempool to use rte stack test/stack: add stack test test/stack: add stack perf test stack: add lock-free stack implementation stack: add C11 atomic implementation test/stack: add lock-free stack tests mempool/stack: add lock-free stack mempool handler MAINTAINERS | 9 +- config/common_base | 5 + doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/env_abstraction_layer.rst | 10 + doc/guides/prog_guide/index.rst | 1 + doc/guides/prog_guide/stack_lib.rst | 83 +++++ doc/guides/rel_notes/release_19_05.rst | 13 + drivers/mempool/stack/Makefile | 3 +- drivers/mempool/stack/meson.build | 6 +- drivers/mempool/stack/rte_mempool_stack.c | 115 +++---- lib/Makefile | 2 + lib/librte_stack/Makefile | 25 ++ lib/librte_stack/meson.build | 10 + lib/librte_stack/rte_stack.c | 219 ++++++++++++ lib/librte_stack/rte_stack.h | 395 ++++++++++++++++++++++ lib/librte_stack/rte_stack_c11_mem.h | 175 ++++++++++ lib/librte_stack/rte_stack_generic.h | 151 +++++++++ lib/librte_stack/rte_stack_pvt.h | 34 ++ lib/librte_stack/rte_stack_version.map | 9 + lib/meson.build | 2 +- mk/rte.app.mk | 1 + test/test/Makefile | 3 + test/test/meson.build | 7 + test/test/test_stack.c | 423 ++++++++++++++++++++++++ test/test/test_stack_perf.c | 356 ++++++++++++++++++++ 26 files changed, 1987 insertions(+), 72 deletions(-) create mode 100644 doc/guides/prog_guide/stack_lib.rst create mode 100644 lib/librte_stack/Makefile create mode 100644 lib/librte_stack/meson.build create mode 100644 lib/librte_stack/rte_stack.c create mode 100644 lib/librte_stack/rte_stack.h create mode 100644 lib/librte_stack/rte_stack_c11_mem.h create mode 100644 lib/librte_stack/rte_stack_generic.h create mode 100644 lib/librte_stack/rte_stack_pvt.h create mode 100644 lib/librte_stack/rte_stack_version.map create mode 100644 test/test/test_stack.c create mode 100644 test/test/test_stack_perf.c -- 2.13.6