This is a basic reimplementation of LIST_* which ensures that list
element updates are visible before the store which adds a new element to
a list. I am posting it mostly for discussion; there are some
outstanding issues:
- No SLIST/STAILQ yet. I will write these if the approach taken here seems reasonable.
- There is only one LIST_FOREACH implementation, meaning that writers are unnecessarily issuing acquire barriers. We could add reader/writer variants, or add an enum to indicate the sense.
- I have not convinced myself that the acquire barriers are necessary to begin with. The release store of the linkage pointer in LIST_INSERT_* should synchronize with the acquire in smr_enter(). Similarly, SMR_LIST_REMOVE shouldn't require barriers.
- I did not add assertion fields to all macros yet.
- I added a hack to allow the use of a void expression in the assertion parameter. e.g., I want to be able to write SMR_LIST_REMOVE(..., mtx_assert(MA_OWNED)). It seems a bit fragile to me though.
I ported D23913 to use the new macros and the changes weren't too bad.