]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use SMR to provide safe unlocked lookup for pctries from SMR zones
authorcem <cem@FreeBSD.org>
Fri, 24 Jul 2020 17:32:10 +0000 (17:32 +0000)
committercem <cem@FreeBSD.org>
Fri, 24 Jul 2020 17:32:10 +0000 (17:32 +0000)
commit302dcf6e712f56842c1ad784b60357fba595666e
treedb5b6b16fa8712aebd145e10d5674f854114267a
parent1a763adf3f5273bf3ad29ee4071ec3ec9cfbb30d
Use SMR to provide safe unlocked lookup for pctries from SMR zones

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.

As future work, it might be nice to add vm_radix algorithms missing from
generic pctrie to the pctrie interface, and then adapt vm_radix to use
pctrie.

Reported by: Attilio
Reviewed by: markj
Sponsored by: Isilon
Differential Revision: https://reviews.freebsd.org/D25781
sys/kern/subr_pctrie.c
sys/sys/pctrie.h