forked from namhyung/uftrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mcount: Change TLS type to initial-exec
-. Benefit changed the model of the TLS variable mtd to initial-exec. The initial-exec model doesn't ocurred problem because it is not make any calls to refer the TLS. the way to refer to variables in the intial-exec is adding or subtracting offsets from static TLS blocks as follows. mov 0x2d6a6 (% rip),% rax # 35fc8 <.got + 0x38> mov% fs: (% rax),% rbx as a rough bench result, the initial-exec type TLS variable can be expected to increase the reference speed by about x2 times or more than the TLS variable using the POSIX pthread. In addition, the initial-exec type TLS variable could be expected to improve the reference speed by about 20% compared to the dynamic type TLS variable created when using a general __thread. -. Limitation the initial-exec TLS model have limitation. TLS will allocated by loader and the initial-exec TLS block allocate statically. after process already running and the initial-exec allocated, it can be that there is not enough space in initial-exec static TLS block to allocate mtd. typical execution environment no need to worry about. --. Limitation mitigation but to prepare future update, there is need to reduce size of `tls_mtd` to minimized. added new two TLS variable pointer `mtd_tls` and bool `mcount_recursion_marker`. allocate `struct mcount_thread_data` to heap. and manage it by `*tls_mtd` which declared as TLS variable. and `mcount_recursion_marker` has same role with `mcount_recursion_marker` that inside of `struct mcount_thread_data`. -.. reference For more information on this, please see the following link: https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt reference document written in Korean : https://die4taoam.tistory.com/37 Signed-off-by: Hanbum Park <kese111@gmail.com>
- Loading branch information
1 parent
2a30257
commit 8851fa6
Showing
3 changed files
with
53 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters