Page MenuHomeFreeBSD

Use SMR to provide safe unlocked lookup for pctries from SMR zones
ClosedPublic

Authored by cem on Jul 22 2020, 10:43 PM.
Tags
None
Referenced Files
F81593465: D25781.id74824.diff
Thu, Apr 18, 4:07 PM
Unknown Object (File)
Tue, Apr 16, 1:08 PM
Unknown Object (File)
Thu, Apr 11, 11:45 PM
Unknown Object (File)
Feb 2 2024, 2:47 AM
Unknown Object (File)
Jan 16 2024, 10:59 AM
Unknown Object (File)
Dec 21 2023, 10:47 PM
Unknown Object (File)
Dec 20 2023, 7:47 AM
Unknown Object (File)
Dec 13 2023, 1:04 PM
Subscribers

Details

Summary

Adapt r358130, for the almost identical vm_radix, to the pctrie subsystem.
Like that change, the tree is kept correct for readers with store barriers
and careful ordering. Existing locks serialize writers.

Add a PCTRIE_DEFINE_SMR() wrapper that takes an additional smr_t parameter
and instantiates a FOO_PCTRIE_LOOKUP_UNLOCKED() function, in addition to the
usual definitions created by PCTRIE_DEFINE().

Interface consumers will be introduced in later commits.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32512
Build 29984: arc lint + arc unit

Event Timeline

cem requested review of this revision.Jul 22 2020, 10:43 PM
cem created this revision.

What exactly prevents vm_radix from using this code instead of having duplication? The node structures have identical layout.

sys/kern/subr_pctrie.c
107

I think the comment from vm_radix_node_get() should be duplicated as well.

716

Wouldn't child be a better name than tmp? Ditto below.

What exactly prevents vm_radix from using this code instead of having duplication? The node structures have identical layout.

I don't know; this predates me. Jeff probably has a better idea. Looks like vm_radix dates to a 2009 GSoC / 2011 Attilio r226645. pctrie dates to 2013 Jeff r250551.

Has pindex_t always been uint64_t, or was it 32-bit on 32-bit platforms in the past? pctrie.h is a 64-bit index only API.

sys/kern/subr_pctrie.c
107

Sure, will do.

716

tmp matches vm_radix_remove(). As the codebases are mostly complete duplicates, I'd prefer to keep these in sync.

cem marked an inline comment as done.

Replicate vm_radix_node_get comment to pctrie_node_get.

In D25781#571011, @cem wrote:

What exactly prevents vm_radix from using this code instead of having duplication? The node structures have identical layout.

I don't know; this predates me. Jeff probably has a better idea. Looks like vm_radix dates to a 2009 GSoC / 2011 Attilio r226645. pctrie dates to 2013 Jeff r250551.

Has pindex_t always been uint64_t, or was it 32-bit on 32-bit platforms in the past? pctrie.h is a 64-bit index only API.

I think pindex_t has always been 64 bits wide, at least since vm_radix.c and this code were committed.

This revision is now accepted and ready to land.Jul 24 2020, 2:43 PM