Page MenuHomeFreeBSD

umtx: Add bitset member to the struct umtx_q.
ClosedPublic

Authored by dchagin on Jul 20 2021, 2:09 PM.
Tags
None
Referenced Files
F81645338: D31234.id92602.diff
Fri, Apr 19, 10:14 AM
Unknown Object (File)
Wed, Apr 17, 8:38 AM
Unknown Object (File)
Mar 7 2024, 8:43 PM
Unknown Object (File)
Feb 23 2024, 12:52 AM
Unknown Object (File)
Feb 20 2024, 9:13 AM
Unknown Object (File)
Jan 14 2024, 4:46 AM
Unknown Object (File)
Nov 13 2023, 7:55 AM
Unknown Object (File)
Nov 13 2023, 6:14 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/kern_umtx.c
573

Why is it hard-coded to SHARED_QUEUE?

sys/sys/umtxvar.h
122–125

There is a hole here on LP64, if you add the new field here the size of the structure will not grow.

sys/kern/kern_umtx.c
573

EXCLUSIVE_QUEUE used only by rw_lock, many umtx functions hide queue, umtxq_insert/umtxq_remove pair for example

sys/sys/umtxvar.h
122–125

good, thanks, will fix it

sys/kern/kern_umtx.c
574
if (uf == NULL)
  return (0);

Then decrease indent level by one.

575

I do not know the intent, but what if there is a hole in the queue WRT bitmask? I mean, e.g. if we have thee elements with the uq_bitset values 1, 2, 4, and bitset is 5. Then you miss the element 4.

sys/sys/umtxvar.h
124

If the field is 32bit mask, then might be uint32_t type is better? It is explicit.

whoops, perhaps I fixed it

This revision is now accepted and ready to land.Jul 21 2021, 7:20 PM