Page MenuHomeFreeBSD

Document robustness implementation and quirks.
ClosedPublic

Authored by kib on May 17 2016, 10:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 5:50 PM
Unknown Object (File)
Sun, Nov 10, 7:42 PM
Unknown Object (File)
Oct 8 2024, 12:24 AM
Unknown Object (File)
Oct 3 2024, 4:22 PM
Unknown Object (File)
Sep 18 2024, 8:48 AM
Unknown Object (File)
Sep 16 2024, 4:58 PM
Unknown Object (File)
Sep 13 2024, 4:54 PM
Unknown Object (File)
Sep 8 2024, 11:01 PM
Subscribers

Details

Summary

Documented robustness for _umtx_op(2), and updated libthr(3) for knobs added by robust mutexes commit,

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib retitled this revision from to Document robustness implementation and quirks..
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added reviewers: emaste, manpages.
kib set the repository for this revision to rS FreeBSD src repository - subversion.
kib edited edge metadata.

Some rewording.

As usual lots of minor comments on articles, and a few confusing parts

lib/libc/sys/_umtx_op.2
108

a non-recoverable state

126

I think robust is a name that's not particularly descriptive, and wonder if we should say something like
Mutex is robust, as described in the ROBUST UMUTEXES section below

128

in a transient

441

On thread termination, the kernel walks two lists of mutexes.

442

Probably
The two list head addresses must be provided by a prior

445

singly-linked. The link to the next

450

the kernel
"either" implies there will be two conditions.

What about:

Robust list processing is aborted if the kernel finds a mutex with any of the following conditions:

  • the UMUTEX_ROBUST flag is not set
  • not owned by the current thread, except...
  • the combination of flags is invalid
  • read of the umutex memory faults
  • the list length limit described in libthr(3) is reached
453

without the

473

For each iteration, the mutex is

Although perhaps there's no need to refer to iterating here at all, and just describe it as:

Every mutex in both lists is unlocked as if...

484

Perhaps: is locked using the UMTX_OP_MUTEX_LOCK operation?
I.e., because lock here refers to the operation, not a state?

488

Also, the kernel handles the UMUTEX_RB_NOTRECOV value of the m_owner field specially, always returning the ENOTRECOVERABLE error for lock attempts, without granting the lock.

1163

The plurals seem awkward to me here. Does "register the list heads for the current thread's robust mutex lists" seem OK?

Or, Register the robust lists's heads for the curren thread

1186–1187

shared robust locked mutexes seems confusing
does "element in the list of locked robust shared mutexes" seem OK?

1197

a pointer to

1202

The kernel inspects

1205–1209

seems like something is missing here. Right now, it reads as "if the mutex ... is handled more loose," ... then what?

1289

Maybe umutex where the m_owner field

1302

The lock was

1353

unlocking a robust

1357

allows another thread

1363

A possible... strengthen the checks

lib/libthr/libthr.3
208

by a mapped file

211

makes such a shared lock object persist ...

212

by the Virtual

213

mapped, the kernel

217

The kernel will...

222

A non-zero value makes...

223

prematurely aborted after detecting some inconsistency, as a...

231

locks a given

kib marked 28 inline comments as done.
kib edited edge metadata.

Apply the editings after emaste review.

emaste edited edge metadata.

LGTM with one remaining nit.

lib/libc/sys/_umtx_op.2
1207

loosly

This revision is now accepted and ready to land.May 19 2016, 5:28 PM
This revision was automatically updated to reflect the committed changes.