On Sat, Jun 25, 2016 at 09:00:45AM +1000, Dave Chinner wrote:
> Sorry, but this is simply broken - allowing apps to opt-in behavior
> (e.g. like we're using O_DIRECT) is always fine. Requriring
> filesystem-specific tuning that has affect outside the app to get
> existing documented behavior is not how to design APIs.
Using DAX is an *admin decision*, not an application decision.
Of course - that's exactly my point.
Indeed, it's a mount option right now, and that's most
something the application can turn on or off! Inode flags allow the
admin to decide that two apps working on the same filesystem can use
(or not use) DAX independently, rather than needing to put them on
Right. And an existing application can get DAX turned on under its
back, and will now suddently get different synchronization behavior.
That is if it's writes happen to be aligned to the fs block size.
> Maybe we'll need to opt-in to use DAX for mmap, but giving
> existing behavior for read and write and avoiding a copy to the pagecache
> is an obvious win.
You can't use DAX just for mmap. It's an inode scope behaviour -
once it's turned on, all accesses to that inode - regardless of user
interface - must use DAX. It's all or nothing, not a per file
descript/mmap context option.
Right now it is. But when discussing mmap behavior one option was to
require an opt-in to get DAX-specific mmap semantics. For plain
read/write we have no such option and thus absolutely need to behave as
all normal reads and writes behave. If you think the exclusive lock
for writes hurts we have two options:
a) implement range locks (although they might be more expensive for
b) add a new O_* or RWF_* option to not require the synchronization
for apps that don't want it.
Neither of those cases really is DAX-specific.