On Thu, 2015-08-20 at 13:27 -0700, Dan Williams wrote:
[...]
> With regards to the fencing, since we already take care to flush
> writes we don't need to fence at all for the flush, right?  All we
> care about is that reads see valid data.

We were careful to flush writes, but we could still have (now stale) data in
the cache either due to a previous read or because of prefetching.  So we
need to flush, and we need to fence to make sure that our flushing stays
correctly ordered with respect to our reads.

So, to recap, I think are options are:

a)
        loop through aperture segments, flushing each without any fencing
        mb() to order all the flushes
        loop through aperture segments, doing the reads

b)
        loop through aperture segments
                flushing segment with mb() fencing
                read the new data for this segment from the DIMM
        
Option b) is what is already implemented and is cleaner, but option a) has the
benefit of having many fewer fences.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to