CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2015/07/01 19:34:00
Modified files: share/man/man9 : Makefile sys/arch/alpha/include: cpu.h sys/arch/amd64/include: cpu.h sys/arch/hppa/include: cpu.h sys/arch/i386/include: cpu.h sys/arch/m88k/include: cpu.h sys/arch/mips64/include: cpu.h sys/arch/powerpc/include: cpu.h sys/arch/sparc64/include: cpu.h sys/conf : files sys/kern : init_main.c sys/sys : param.h Added files: share/man/man9 : srp_enter.9 sys/kern : kern_srp.c sys/sys : srp.h Log message: 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@