#
19419d36 |
| 19-May-2025 |
Mark Johnston <markj@FreeBSD.org> |
libc: Give __thr_jtable protected visibility
This function pointer table is overwritten by libthr when it's loaded. libc's pthread stubs are implemented by looking up an entry in this table and invo
libc: Give __thr_jtable protected visibility
This function pointer table is overwritten by libthr when it's loaded. libc's pthread stubs are implemented by looking up an entry in this table and invoking the function pointer contained in the entry.
pthread calls are fairly expensive even when libthr is not loaded: each call involves indirection through the PLT, then through the GOT to look up __thr_jtable, then the function pointer itself. We can however eliminate one level of indirection by disallowing preemption of the __thr_jtable symbol, and since the existence table is an internal implementation detail, disabling preemption is unlikely to break anything. This gives a modest improvement in some microbenchmarks which call libc's pthread stubs.
Reviewed by: kib MFC after: 1 month Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D50354
show more ...
|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0 |
|
#
3cc3d71e |
| 14-Nov-2024 |
Kyle Evans <kevans@FreeBSD.org> |
libc: fix the stubs for pthread_{suspend,resume}_all_np
Noticed just a little too late, stub_null returns a `void *` but these prototypes have no return value. As far as I know, all of our archs wi
libc: fix the stubs for pthread_{suspend,resume}_all_np
Noticed just a little too late, stub_null returns a `void *` but these prototypes have no return value. As far as I know, all of our archs will throw the return value in a caller-saved register and it'll simply be ignored, but it's probably worth being more accurate.
Fixes: 83aafcdc8892 ("libc, libthr: coordinate stubs for [...]")
show more ...
|
#
83aafcdc |
| 14-Nov-2024 |
Kyle Evans <kevans@FreeBSD.org> |
libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
If libthr isn't linked into the process, then we don't have any pthreads to worry about and our stubs can just return success -- th
libc, libthr: coordinate stubs for pthread_{suspend,resume}_all_np
If libthr isn't linked into the process, then we don't have any pthreads to worry about and our stubs can just return success -- there are none to suspend/resume.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47350
show more ...
|
Revision tags: release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
559a218c |
| 01-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
libc: Purge unneeded cdefs.h
These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Kee
libc: Purge unneeded cdefs.h
These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
show more ...
|
#
89e17c6e |
| 21-Aug-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
libc/gen/_pthread_stubs.c: Remove stray whitespaces
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
#
0dc52b72 |
| 15-Aug-2023 |
Minsoo Choo <minsoochoo0122@proton.me> |
libc: export pthread_getname_np stub
pthread_getname_np needs to be provided by libc in order to import jemalloc 5.3.0.
A stub implementation for libc pthread_getname_np() is added for _pthread_stu
libc: export pthread_getname_np stub
pthread_getname_np needs to be provided by libc in order to import jemalloc 5.3.0.
A stub implementation for libc pthread_getname_np() is added for _pthread_stubs.c, which always reports empty name for the main thread.
Internal _pthread_getname_np() is not exported, but provided for libc own use.
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41461
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0 |
|
#
412ef5da |
| 28-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
libc: Add pthread_attr_get_np(3) stub, reporting ESRCH.
This seems to be required by recent clang asan. I do not see other way than put the symbol under FBSD_1.0 version.
PR: 251112 Reported by: An
libc: Add pthread_attr_get_np(3) stub, reporting ESRCH.
This seems to be required by recent clang asan. I do not see other way than put the symbol under FBSD_1.0 version.
PR: 251112 Reported by: Andrew Stitcher <astitcher@apache.org> Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27389
show more ...
|
#
1a1b8b1c |
| 26-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Remove stray column.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
|
#
f2148ee0 |
| 25-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Use designated initializers for libc pthread stubs' jump table.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0 |
|
#
7f49ce7a |
| 28-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349476
Sponsored by: The FreeBSD Foundation
|
#
2d8c3eeb |
| 23-Jun-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Add libc stub for pthread_getthreadid_np(3).
Requested by: jbeich PR: 238650 Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
d915a14e |
| 25-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
libc: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error p
libc: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
Revision tags: release/10.4.0 |
|
#
531c2d7a |
| 24-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r320180
|
#
bca9d05f |
| 23-Jul-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r319973 through 321382.
|
Revision tags: release/11.1.0 |
|
#
f6e653bb |
| 02-Jul-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r320398 through r320572.
|
#
c89a3f00 |
| 02-Jul-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Correct signatures of several pthreads stubs.
Most important, use a correct signature for the __pthread_cleanup_push_imp() stub, which was incorrectly generated with two-args variant. The pthread_c
Correct signatures of several pthreads stubs.
Most important, use a correct signature for the __pthread_cleanup_push_imp() stub, which was incorrectly generated with two-args variant. The pthread_cleanup_info pointer was corrupted in the forwarded call to the real libthr implementation, visible on PowerPC and possibly ARM. [1]
Found and tested by: Mark Millard <markmi@dsl-only.net> [1] Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
Revision tags: release/11.0.1, release/11.0.0 |
|
#
2a339d9e |
| 17-May-2016 |
Konstantin Belousov <kib@FreeBSD.org> |
Add implementation of robust mutexes, hopefully close enough to the intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.
A robust mutex is guaranteed to be cleared by the system upon either thr
Add implementation of robust mutexes, hopefully close enough to the intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.
A robust mutex is guaranteed to be cleared by the system upon either thread or process owner termination while the mutex is held. The next mutex locker is then notified about inconsistent mutex state and can execute (or abandon) corrective actions.
The patch mostly consists of small changes here and there, adding neccessary checks for the inconsistent and abandoned conditions into existing paths. Additionally, the thread exit handler was extended to iterate over the userspace-maintained list of owned robust mutexes, unlocking and marking as terminated each of them.
The list of owned robust mutexes cannot be maintained atomically synchronous with the mutex lock state (it is possible in kernel, but is too expensive). Instead, for the duration of lock or unlock operation, the current mutex is remembered in a special slot that is also checked by the kernel at thread termination.
Kernel must be aware about the per-thread location of the heads of robust mutex lists and the current active mutex slot. When a thread touches a robust mutex for the first time, a new umtx op syscall is issued which informs about location of lists heads.
The umtx sleep queues for PP and PI mutexes are split between non-robust and robust.
Somewhat unrelated changes in the patch: 1. Style. 2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared pi mutexes. 3. Removal of the userspace struct pthread_mutex m_owner field. 4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls the lifetime of the shared mutex associated with a vnode' page.
Reviewed by: jilles (previous version, supposedly the objection was fixed) Discussed with: brooks, Martin Simmons <martin@lispworks.com> (some aspects) Tested by: pho Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0, release/8.4.0, release/9.1.0, release/8.3.0_cvs, release/8.3.0 |
|
#
8fa0b743 |
| 23-Jan-2012 |
Xin LI <delphij@FreeBSD.org> |
IFC @230489 (pending review).
|
#
80dbff4e |
| 04-Jan-2012 |
Sean Bruno <sbruno@FreeBSD.org> |
IFC to head to catch up the bhyve branch
Approved by: grehan@
|
Revision tags: release/9.0.0 |
|
#
5bf69a4b |
| 26-Nov-2011 |
David Chisnall <theraven@FreeBSD.org> |
style(9) fix.
Approved by: dim (mentor)
|
#
48cb9786 |
| 26-Nov-2011 |
David Chisnall <theraven@FreeBSD.org> |
Return not-implemented from pthread_once and pthread_key_create, rather than silently failing and returning success.
Without this, code calls pthread_once(), receives a return value of success, and
Return not-implemented from pthread_once and pthread_key_create, rather than silently failing and returning success.
Without this, code calls pthread_once(), receives a return value of success, and thinks that the passed function has been called.
Approved by: dim (mentor)
show more ...
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
f4213b90 |
| 25-Sep-2010 |
David Xu <davidxu@FreeBSD.org> |
To support stack unwinding for cancellation points, add -fexceptions flag for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellatio
To support stack unwinding for cancellation points, add -fexceptions flag for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellation point, it also makes it possible that other functions can be cancellation points in libraries without having to be rewritten in libthr.
show more ...
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0 |
|
#
1a0fda2b |
| 04-Mar-2010 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
IFH@204581
|