path: root/sys/sys
diff options
authorDmitry Chagin <dchagin@FreeBSD.org>2021-07-29 09:42:49 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2021-07-29 09:42:49 +0000
commit7caa29115b4a2023128ed07942b71074507a44a1 (patch)
treefa7c8dec5f5a65a92f2f9c31404aa5a43a3961b4 /sys/sys
parent1fdcc87cfd6775896d3cb46bb677dc2a15cfd9ac (diff)
umtx: Add bitset conditional wakeup functionality.
The bitset is a Linux emulation layer extension. This 32-bit mask, in which at least one bit must be set, is used to select which threads should be woken up. The bitset is stored in the umtx_q structure, which is used to enqueue the waiter into the umtx waitqueue. Put the bitset into the hole, that appeared on LP64 due to data alignment, to prevent the growth of the struct umtx_q. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31234 MFC after: 2 weeks
Diffstat (limited to 'sys/sys')
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h
index 68f261fe6abf..de1b649ed8d7 100644
--- a/sys/sys/umtxvar.h
+++ b/sys/sys/umtxvar.h
@@ -120,6 +120,9 @@ struct umtx_q {
int uq_flags;
#define UQF_UMTXQ 0x0001
+ /* Futex bitset mask */
+ u_int uq_bitset;
/* The thread waits on. */
struct thread *uq_thread;
@@ -207,6 +210,7 @@ void umtxq_free(struct umtx_q *);
struct umtxq_chain *umtxq_getchain(struct umtx_key *);
void umtxq_insert_queue(struct umtx_q *, int);
void umtxq_remove_queue(struct umtx_q *, int);
+int umtxq_signal_mask(struct umtx_key *, int, u_int);
int umtxq_sleep(struct umtx_q *, const char *,
struct umtx_abs_timeout *);
void umtxq_unbusy(struct umtx_key *);