From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] mk: using initial-exec model for thread local variable Date: Thu, 05 Jul 2018 11:25:09 +0200 Message-ID: <1722333.AV9Rg5NKm1@xps> References: <20180705141321.129989-1-yong.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: zhiyong.yang@intel.com, dev@dpdk.org, techboard@dpdk.org To: Marvin Liu Return-path: In-Reply-To: <20180705141321.129989-1-yong.liu@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" 05/07/2018 16:13, Marvin Liu: > When building share library, thread-local storage model will be changed > to global-dynamic. It will add additional cost for reading thread local > variable. On the other hand, dynamically load share library with static > TLS will request additional DTV slot which is limited by loader. By now > only librte_pmd_eal.so contain thread local variable. So that can make > TLS model back to initial-exec like static library for better > performance. > > Signed-off-by: Marvin Liu > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > index 7e4531bab..19d5e11ef 100644 > --- a/mk/toolchain/gcc/rte.vars.mk > +++ b/mk/toolchain/gcc/rte.vars.mk It is only for GCC? not clang? > +# Initial execution TLS model has better performane compared to dynamic > +# global. But this model require for addtional slot on DTV when dlopen > +# object with thread local variable. Few typos in this comment. > +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > +TOOLCHAIN_CFLAGS += -ftls-model=initial-exec > +endif We really need more test or review of this patch. Cc techboard: do we take the risk of getting it in RC1 without review? It is waiting for long.