On 02/23/2016 11:47 PM, Dave Chinner wrote:
i.e. what we've implemented right now is a basic, slow,
easy-to-make-work-correctly brute force solution. That doesn't mean
we always need to implement it this way, or that we are bound by the
way dax_clear_sectors() currently flushes cachelines before it
returns. It's just a simple implementation that provides the
ordering the *filesystem requires* to provide the correct data
integrity semantics to userspace.
Or it can be written properly with movnt instructions and be even
faster the a simple memset, and no need for any cl_flushing let alone
any radix-tree locking.
That said your suggestion above is 25%-100% slower than current code
because the cl_flushes will be needed eventually, and the atomics of a
lock takes 25% the time of a full page copy. You are forgetting we are
talking about memory and not harddisk. the rules are different.
(Cumming from NFS it took me a long time to adjust)
I'll send a patch to fix this