Page MenuHomeFreeBSD

Add comments about off-page subtleties
ClosedPublic

Authored by kib on Feb 29 2016, 11:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 10:47 PM
Unknown Object (File)
Jan 31 2024, 2:11 PM
Unknown Object (File)
Dec 29 2023, 4:21 PM
Unknown Object (File)
Nov 20 2023, 12:54 AM
Unknown Object (File)
Nov 18 2023, 8:14 AM
Unknown Object (File)
Nov 17 2023, 2:15 AM
Unknown Object (File)
Nov 14 2023, 9:12 AM
Unknown Object (File)
Nov 6 2023, 4:22 PM
Subscribers

Details

Summary

Explain two issues in the pshared implementation which affect correctness.

Please help me to fix the language.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib retitled this revision from to Add comments about off-page subtleties.
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added a reviewer: emaste.
kib set the repository for this revision to rS FreeBSD src repository - subversion.
lib/libthr/thread/thr_pshared.c
90–92 ↗(On Diff #13883)

Maybe more clear as:
Among all processes sharing a lock only one executes pthread_lock_destroy(). Other processes still have the hash and mapped off-page.

94–97 ↗(On Diff #13883)

Looks good.

146 ↗(On Diff #13883)

I'd suggest:
return either the new (just mapped) or old (hashed)

151 ↗(On Diff #13883)

not yet stored in or not yet included in

155 ↗(On Diff #13883)

the value from the hash, the first thread might operate on

but then this gets rather confusing.

Otherwise, if we unmap the value obtained from the hash, the first thread might operate on an unmapped off-page object.

158–161 ↗(On Diff #13883)

How about:

There is still an issue: if the hashed key was unmapped and then another page is mapped at the same key address, the hash would return the old val.

Also clarify 'handle race' -- i.e., what happens if there's a race?

kib marked 4 inline comments as done.Mar 1 2016, 10:23 AM
kib added inline comments.
lib/libthr/thread/thr_pshared.c
158–161 ↗(On Diff #13883)

The race was explained in the paragraph above. I made more evolved reference to it in the revised text.

emaste edited edge metadata.

LGTM with the additional clarification we discussed on IRC.

This revision is now accepted and ready to land.Mar 1 2016, 3:16 PM
This revision was automatically updated to reflect the committed changes.