CVSROOT: /cvs Module name: src Changes by: v...@cvs.openbsd.org 2019/02/26 07:24:21
Modified files: sys/conf : files sys/kern : init_main.c kern_sched.c sched_bsd.c sys/sys : sched.h sys/uvm : uvm_page.c Added files: sys/kern : kern_smr.c sys/sys : smr.h Log message: Introduce safe memory reclamation, a mechanism for reclaiming shared objects that readers can access without locking. This provides a basis for read-copy-update operations. Readers access SMR-protected shared objects inside SMR read-side critical section where sleeping is not allowed. To reclaim an SMR-protected object, the writer has to ensure mutual exclusion of other writers, remove the object's shared reference and wait until read-side references cannot exist any longer. As an alternative to waiting, the writer can schedule a callback that gets invoked when reclamation is safe. The mechanism relies on CPU quiescent states to determine when an SMR-protected object is ready for reclamation. The <sys/smr.h> header additionally provides an implementation of singly- and doubly-linked lists that can be used together with SMR. These lists allow lockless read access with a concurrent writer. Discussed with many OK mpi@ sashan@