diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-07-02 01:34:01 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-07-02 01:34:01 +0000 |
commit | 2277e32f451a4f2c2df9aa238a1ebc6e7d6e6993 (patch) | |
tree | ff697f8d41973078e583ab4e3ceabd929083ff04 /usr.sbin/cron | |
parent | 2ccfb985fa190982dc0c9985889c6cfb80d7268d (diff) |
introduce srp, which according to the manpage i wrote is short for
"shared reference pointers".
srp allows concurrent access to a data structure by multiple cpus
while avoiding interlocking cpu opcodes. it manages its own reference
counts and the garbage collection of those data structure to avoid
use after frees.
internally srp is a twisted version of hazard pointers, which are
a relative of RCU.
jmatthew wrote the bulk of a hazard pointer implementation and
changed bpf to use it to allow mpsafe access to bpfilters. however,
at s2k15 we were trying to apply it to other data structures but
the memory overhead of every hazard pointer would have blown out
significantly in several uses cases. a bulk of our time at s2k15
was spent reworking hazard pointers into srp.
this diff adds the srp api and adds the necessary metadata to struct
cpuinfo on our MP architectures. srp on uniprocessor platforms has
alternate code that is optimised because it knows there'll be no
concurrent access to data by multiple cpus.
srp is made available to the system via param.h, so it should be
available everywhere in the kernel.
the docs likely need improvement cos im too close to the implementation.
ok mpi@
Diffstat (limited to 'usr.sbin/cron')
0 files changed, 0 insertions, 0 deletions