openafs/src/mcas
matt@linuxbox.com 24ddc90e5d Add tracing to MCAS allocator and GC
Adds conditional trace logging to MCAS object cache and supporting GC,
using ViceLog.  While in future this should be normalized, it is correct
for both fileserver and volserver, the two programs using MCAS currently.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/374
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-03 12:35:25 -07:00
..
alpha_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
amd64_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
bst_lock_fraser.c
bst_lock_kung.c
bst_lock_manber.c
bst_mcas.c
gc.c Add tracing to MCAS allocator and GC 2009-09-03 12:35:25 -07:00
gc.h Add tracing to MCAS allocator and GC 2009-09-03 12:35:25 -07:00
ia64_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
intel_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
Makefile.mcas
Makefile.osi MCAS changes from Matt 2009-08-10 07:01:40 -07:00
Makefile.unit MCAS changes from Matt 2009-08-10 07:01:40 -07:00
mcas.c
mips_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
osi_mcas_atomic.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
osi_mcas_obj_cache.c Add tracing to MCAS allocator and GC 2009-09-03 12:35:25 -07:00
osi_mcas_obj_cache.h Add tracing to MCAS allocator and GC 2009-09-03 12:35:25 -07:00
portable_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
ppc_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
ptst.c
ptst.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
random.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
rb_lock_concurrentwriters.c
rb_lock_mutex.c
rb_lock_serialisedwriters.c
rb_stm.c
README
README_LICENSE
replay.c
set_adt.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
set_harness.c
set_queue_adt.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
set.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
skip_adt_test.c MCAS changes from Matt 2009-08-10 07:01:40 -07:00
skip_cas_adt.c Add tracing to MCAS allocator and GC 2009-09-03 12:35:25 -07:00
skip_cas_func.c MCAS changes from Matt 2009-08-10 07:01:40 -07:00
skip_cas.c
skip_lock.c
skip_mcas.c
skip_stm.c
solaris_amd64_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
solaris_x86_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
sparc_defns.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
sparc_mcas.il
stm_fraser.c
stm_herlihy.c
stm_lock.c
stm.h MCAS changes from Matt 2009-08-10 07:01:40 -07:00
TODO MCAS changes from Matt 2009-08-10 07:01:40 -07:00

 The Lock-Free Library
 =====================


1. Building
-----------
Edit the Makefile and set ARCH to the appropriate value.
Type 'make'.


2. What you get
---------------
'stm_fraser.c' is an object-based STM with the programming API defined
in 'stm.h'. 'mcas.c' is an implementation of multi-word
compare-and-swap.

These are used to build a number of search structures: skip lists,
binary search trees, and red-black trees. The executables are named as
follows:

 bst_lock_fraser      --- BST implementation using per-node locks.
                          No locking for read operations.
 bst_lock_kung        --- BST implementation using per-node locks.
                          No locking for read operations.
 bst_lock_manber      --- BST implementation using per-node locks.
                          No locking for read operations.
 bst_mcas             --- BST implementation based on MCAS.

 rb_lock_concurrentwriters --- Red-black trees with concurrent writers.
                               Based on MCS multi-reader locks.
 rb_lock_serialisedwriters --- Red-black trees with serialised writers.
                               Based on MCS multi-reader locks.
 rb_lock_mutex        --- Red-black trees with concurrent writers, and
                          no locking for read operations. Very fast!
 rb_stm_fraser        --- Red-black trees using Fraser's STM.
 rb_stm_herlihy       --- Red-black trees using Herlihy et al's STM.
 rb_stm_lock          --- Red-black trees using 2-phase-locking STM.

 skip_lock_perlist    --- Skip lists with a single global lock.
                          No locking for read operations.
 skip_lock_pernode    --- Skip lists with a lock per node.
                          No locking for read operations.
 skip_lock_perpointer --- Skip lists with a lock per pointer.
                          No locking for read operations.
 skip_cas             --- Skip lists built directly from CAS.
 skip_mcas            --- Skip lists based on MCAS.
 skip_stm_fraser      --- Skip lists using Fraser's STM.
 skip_stm_herlihy     --- Skip lists using Herlihy et al's STM.
 skip_stm_lock        --- Skip lists using 2-phase-locking STM.

Each executable is run as:
 <executable> <num_threads> <read_proportion> <key power>

'executable' is one of the above implementations.

'num_threads' indicates the degree of parallelism.

'read_proportion' determines what proportion of the random workload is
lookups as opposed to updates or removals. The proportion is out of 256.

'key_power' indicates the key range. Key range is 2 ^ 'key_power'.
Since updates and removals are equally probable, the mean set size
will be 2 ^ ('key power' - 1).


3. Verifying correctness
------------------------
To check that each implementation correctly behaves as a 'set' ought
to, you can define DO_WRITE_LOG in 'set_harness.c'. This will cause
each implementation to produce a log describing each operation that
was executed, and its result.

This can be run through 'replay' which will serach for a linearisable
schedule.


4. Distribution license
-----------------------
The license is GPL. See the file COPYING for details.


 -- Keir Fraser, 25th September 2003


****

This software has been released by its original author, Keir Fraser,
with permission from his advisors, under a BSD license.  For details, 
please see README.LICENSE.

 -- Matt Benjamin, 07/24/2009