On 25 Nov, 2014, at 00:56 , Taylor R Campbell
<[email protected]> wrote:
> My confusion came from that I thought memory ordering of load is more
> flexible in general. I also didn't quite understand "dependent-load".
> I have been only reading NetBSD kernel code to learn memory ordering;
> and I believe, nothing in the tree utilize this topologycal
> "dependent-load". I may be missing something though.
>
> We do have at least one use of nontrivial data-dependent loads
> in-tree, in pcq(9), as Dennis noted.
More than that, I think. If I'm not mistaken there are also examples in
sys/kern/kern_descrip.c
sys/kern/kern_tc.c
sys/kern/subr_ipi.c
sys/kern/vfs_cache.c
When there is code which fills in a structure, followed by a membar_producer(),
followed by an assignment to a pointer to point at the structure, it is very
unlikely that there will be barriers in the places where the pointer is
dereferenced.
Dennis Ferguson