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
Unknown Object (File)
Nov 19 2024, 8:17 AM
Unknown Object (File)
Oct 14 2024, 11:02 AM
Unknown Object (File)
Oct 4 2024, 7:29 AM
Unknown Object (File)
Oct 1 2024, 7:10 PM
Unknown Object (File)
Oct 1 2024, 5:19 PM
Unknown Object (File)
Oct 1 2024, 4:16 PM
Unknown Object (File)
Sep 28 2024, 9:43 AM
Unknown Object (File)
Sep 28 2024, 9:43 AM
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

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

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 ↗(On Diff #74824)

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

711 ↗(On Diff #74824)

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 ↗(On Diff #74824)

Sure, will do.

711 ↗(On Diff #74824)

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