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
Unknown Object (File)
Mon, Feb 10, 7:58 AM
Unknown Object (File)
Sun, Feb 9, 3:05 PM
Unknown Object (File)
Sat, Jan 25, 7:53 PM
Unknown Object (File)
Sat, Jan 25, 7:52 PM
Unknown Object (File)
Thu, Jan 23, 6:58 PM
Unknown Object (File)
Sat, Jan 18, 5:47 PM
Unknown Object (File)
Sat, Jan 18, 5:35 PM
Unknown Object (File)
Sat, Jan 18, 5:22 PM
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