summaryrefslogtreecommitdiffstats
path: root/lib/libthr
Commit message (Collapse)AuthorAgeFilesLines
* MFHgjb2016-04-161-1/+1
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Unmagic the thread pointer offset.br2016-04-141-1/+1
| |
| * If off-page lookup failed, there is no memory to performkib2016-04-121-1/+2
| | | | | | | | | | | | shared_mutex_init() upon. Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-04-121-1/+2
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-04-1152-116/+178
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Use __FBSDID() for .c files from lib/libthr/thread.kib2016-04-0852-112/+158
| | | | | | | | Sponsored by: The FreeBSD Foundation
| * Use ANSI C function definitions, fix spelling in a comment.kib2016-04-083-4/+5
| | | | | | | | Sponsored by: The FreeBSD Foundation
| * Assert that the lock objects put into the off-page, fit into the page.kib2016-04-085-0/+15
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-04-048-81/+161
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Remove unused variable. It was write-only before r297139.kib2016-04-042-2/+0
| | | | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
| * Apparently there are some popular programs around which assume that itkib2016-03-222-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is safe to call pthread_mutex_init() on the same shared mutex several times. POSIX claims that the behaviour in this case is undefined. Make this working by only allowing one caller to initialize the mutex. Other callers either see already completed initialization and do nothing, or busy-loop yielding while designated initializer finishes. Also make the API requirements loose by initializing mutexes on other pthread_mutex*() calls if they see uninitialized shared mutex. Only mutexes provide the hack for now, but it could be also implemented for other process shared primitives from libthr. Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com> Sponsored by: The FreeBSD Foundation
| * Lock pshared_lock shared around fork, to ensure that the COW snapshotkib2016-03-214-2/+22
| | | | | | | | | | | | | | of the pshared hash in child is consistent and can be safely used. Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com> Sponsored by: The FreeBSD Foundation
| * Provide more information on failing checks in mutex_assert_is_owned()kib2016-03-211-4/+16
| | | | | | | | | | | | | | and mutex_assert_not_owned(). snprintf() use in this context should be safe. Sponsored by: The FreeBSD Foundation
| * From libthr, remove special and strange code to set up session andkib2016-03-212-22/+2
| | | | | | | | | | | | | | | | | | | | | | | | control terminal, activated when running with pid 1. It is application duty to handle this, and unsuspecting init replacements which are linked with libthr would be broken by this. The pre-resolving of getpid() is restored, just in case. Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
| * Implement process-shared spinlocks.kib2016-03-211-48/+59
| | | | | | | | Sponsored by: The FreeBSD Foundation
| * Fix typo.kib2016-03-211-1/+1
| | | | | | | | MFC after: 3 days
* | MFHgjb2016-03-103-0/+63
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-093-0/+63
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-0214-309/+820
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Add two comments explaining the fine points of the hashkib2016-03-011-0/+31
| | | | | | | | | | | | | | | | implementation. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D5490
| * errno(3) -> errno(2)trasz2016-02-291-2/+1
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Implement process-shared locks support for libthr.so.3, withoutkib2016-02-2813-307/+788
| | | | | | | | | | | | | | | | | | | | | | | | breaking the ABI. Special value is stored in the lock pointer to indicate shared lock, and offline page in the shared memory is allocated to store the actual lock. Reviewed by: vangyzen (previous version) Discussed with: deischen, emaste, jhb, rwatson, Martin Simmons <martin@lispworks.com> Tested by: pho Sponsored by: The FreeBSD Foundation
| * If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbolskib2016-02-084-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do not participate in the global symbols namespace, but rtld locks are still replaced and functions are interposed. In particular, __pthread_map_stacks_exec is resolved to the libc version. If a library is loaded later, which requires adjustment of the stack protection mode, rtld calls into libc __pthread_map_stacks_exec due to the symbols scope. The libc version might recurse into binder and recursively acquire rtld bind lock, causing the hang. Make libc __pthread_map_stacks_exec() interposed, which synchronizes rtld locks and version of the stack exec hook when libthr loaded, regardless of the symbol scope control or symbol resolution order. The __pthread_map_stacks_exec() symbol is removed from the private version in libthr since libc symbol now operates correctly in presence of libthr. Reported and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | MFHgjb2016-02-094-4/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | Remove libc, librtld_db, libthr packages, and further increasegjb2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | the constraints on what needs to be installed in a specific to maintain consistency during upgrades. Create a new clibs package containing libraries that are needed as a bare minimum for consistency. With much help and input from: kib Sponsored by: The FreeBSD Foundation
* | First pass through library packaging.gjb2016-02-041-0/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | More 'tests' bug fixes.gjb2016-02-031-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | First pass to fix the 'tests' packages.gjb2016-02-022-0/+6
|/ | | | Sponsored by: The FreeBSD Foundation
* Add pthread MD part for RISC-V.br2016-01-271-0/+92
| | | | | | | Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5063
* libthr: const-ify two variablesvangyzen2016-01-131-2/+3
| | | | | | | | Make the default umutex and urwlock initializers const, because they can be, and as a microoptimization. MFC after: 5 days Sponsored by: Dell Inc.
* Typo.kib2015-12-271-1/+1
|
* libthr: Don't use both __sys_open() and __sys_openat().jilles2015-12-202-2/+1
|
* Start support for the RISC-V 64-bit architecture developed by UC Berkeley.br2015-12-111-0/+1
| | | | | | | | | | | | | | | RISC-V is a new ISA designed to support computer research and education, and is now become a standard open architecture for industry implementations. This is a minimal set of changes required to run 'make kernel-toolchain' using external (GNU) toolchain. The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv. Reviewed by: andrew, bdrewery, emaste, imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4445
* Fix LDADD/DPADD that should be LIBADD.bdrewery2015-12-043-10/+5
| | | | Sponsored by: EMC / Isilon Storage Division
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.bdrewery2015-11-251-1/+0
| | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-123-7/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Style. Use ANSI definition, wrap long lines, no initialization inkib2015-09-081-8/+15
| | | | | | | declaration for locals. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* In the pthread_once(), if the initializer has already run, then thekib2015-09-081-3/+5
| | | | | | | | | | | | | | | | | calling thread is supposed to see accesses issued by the initializer. This means that the read of the once_control->state variable should have an acquire semantic. Use atomic_thread_fence_acq() when the value read is ONCE_DONE, instead of straightforward atomic_load_acq(), to only put a barrier when needed (*). On the other hand, the updates of the once_control->state with the intermediate progress state do not need to synchronize with other state accesses, remove _acq suffix. Reviewed by: alc (previous version) Suggested by: alc (*) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Pre-resolve symbols required for the deferred signal processing. Thiskib2015-08-102-1/+9
| | | | | | | | | | | | | avoids recursion into rtld when leaving libthr critical section for the deferred signal delivery. For the same reason, use syscall(2) instead of referencing __sys_sigreturn(2). Syscall() is already pre-resolved for fork() interceptor. Tested by: Andre Meiser <ortadur@web.de> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Disable SSE in libthrvangyzen2015-08-052-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang emits SSE instructions on amd64 in the common path of pthread_mutex_unlock. If the thread does not otherwise use SSE, this usage incurs a context-switch of the FPU/SSE state, which reduces the performance of multiple real-world applications by a non-trivial amount (3-5% in one application). Instead of this change, I experimented with eagerly switching the FPU state at context-switch time. This did not help. Most of the cost seems to be in the read/write of memory--as kib@ stated--and not in the #NM handling. I tested on machines with and without XSAVEOPT. One counter-argument to this change is that most applications already use SIMD, and the number of applications and amount of SIMD usage are only increasing. This is absolutely true. I agree that--in general and in principle--this change is in the wrong direction. However, there are applications that do not use enough SSE to offset the extra context-switch cost. SSE does not provide a clear benefit in the current libthr code with the current compiler, but it does provide a clear loss in some cases. Therefore, disabling SSE in libthr is a non-loss for most, and a gain for some. I refrained from disabling SSE in libc--as was suggested--because I can't make the above argument for libc. It provides a wide variety of code; each case should be analyzed separately. https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html Suggestions from: dim, jmg, rpaulo Approved by: kib (mentor) MFC after: 2 weeks Sponsored by: Dell Inc.
* cosmetic: whitespaces-tab before EOLpfg2015-07-081-1/+1
| | | | Obtained from: cpi-llvm project
* new dependssjg2015-06-161-0/+1
|
* Revert r284417 it is not necessary anymorebapt2015-06-151-1/+1
|
* Enforce overwritting SHLIBDIRbapt2015-06-151-1/+1
| | | | | | | | | Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere. This makes /lib being populated again. Reported by: many
* Fix typo in comment.kib2015-06-141-2/+2
| | | | MFC after: 3 days
* Add META_MODE support.sjg2015-06-131-0/+17
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-2740-1040/+567
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-1910-6/+358
| |\
| * \ Merge head from 7/28sjg2014-08-198-178/+77
| |\ \
OpenPOWER on IntegriCloud