DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dev@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dpdk-dev] [PATCH] mk: using initial-exec model for thread local variable
Date: Sat, 28 Apr 2018 17:54:07 +0800	[thread overview]
Message-ID: <1524909247-6581-1-git-send-email-yong.liu@intel.com> (raw)

When building share library, thread-local storage model will be changed
to global-dynamic. It will cost additional protect for read thread local
variable. By now only lcore id is this kind of varaible and not need to
dynamic share with other threads. So make TLS model back to initial-exec
like static library for better performance.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index 7e4531b..7b5e71c 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -43,6 +43,10 @@ ifeq (,$(findstring -O0,$(EXTRA_CFLAGS)))
 endif
 endif
 
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+TOOLCHAIN_CFLAGS += -ftls-model=initial-exec
+endif
+
 WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
-- 
1.9.3

             reply	other threads:[~2018-04-28  2:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28  9:54 Marvin Liu [this message]
2018-04-28  4:39 ` Yang, Zhiyong
2018-05-18  9:46   ` Thomas Monjalon
2018-07-05 14:13 Marvin Liu
2018-07-05  9:25 ` Thomas Monjalon
2018-07-05 14:46 ` Sachin Saxena
2018-07-06  2:22   ` Liu, Yong
2018-07-06 10:02     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524909247-6581-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).