xfs
[Top] [All Lists]

Re: xfs: untangle the direct I/O and DAX path, fix DAX locking

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: xfs: untangle the direct I/O and DAX path, fix DAX locking
From: Boaz Harrosh <boaz@xxxxxxxxxxxxx>
Date: Tue, 28 Jun 2016 16:56:30 +0300
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-nvdimm@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexistor-com.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=BziU09rUwOPmvG/puVw8AGNvl/d0bNxPKp+hfzBB8mk=; b=FCZqDex8wFv7RMyIGd0iRnU2XtEnX9jUEj/eqss2hhph/E1aFJGobC+3MF6VvUuVOY 1SKo2ViMZ3J772UaFb8oKsI6UROTuEKgcJlW3jy/C5l+B12OdQfYszTG5ZKtZuCFw8lW Yo0am7fY9L9GbMSNaL0y4JfifFqFUk+tGxnYr+81BoWuY+NnM3eRBIJG0u7/IWmHI966 AYB/+n09mti9z+FwFf3bk+XG3BX1D9MiBJ/DIfAvn+VvfVp7KLFtvgC1UYF1DDRS7krn T+YrYk01rgpItbcvax/5Kh3nd59sRb/5KmYT3E0j4UftcB2o4MpOR8QHciL2pfk8FQz4 lSoQ==
In-reply-to: <20160628133928.GB31283@xxxxxx>
References: <1466609236-23801-1-git-send-email-hch@xxxxxx> <20160623232446.GA12670@dastard> <20160624072612.GA22205@xxxxxx> <20160624230045.GG12670@dastard> <20160628131059.GA30475@xxxxxx> <57727B27.7060104@xxxxxxxxxxxxx> <20160628133928.GB31283@xxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
On 06/28/2016 04:39 PM, Christoph Hellwig wrote:
> On Tue, Jun 28, 2016 at 04:27:03PM +0300, Boaz Harrosh wrote:
>>> 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.
>>>
>>
>> Is there an actual application that does that? or is this purely
>> theoretical right now?
> 
> Lots of them.  The typical case is multithreaded (or preforked like old
> apache) daemons that use O_APPEND to write to a common log file.  Then
> again those log records will usually not be 4k aligned, so they'd still
> accidentally get the exclusive locking even without this patch.  But
> beware the case where a log record actually matches the alignment..
> 

But O_APPEND is exclusion problem of i_size update not of the actual memcpy
done in parallel or not.

Actually with O_APPEND each write request should write a different region
of the file, there are no overlapping writes. And no issue of which version of 
the
write came last and got its data written.

If it is the issue of isize update vs O_APPEND is a different issue don't
you think? One way that we solved it is to update isize = isize + len;
atomically before starting the IO, then on the error case sub the unwritten
bytes. And still allow concurrent writers. I agree that isize updates needs
to be atomic, but why does the memcpy?

And BTW in NFS O_APPEND concurrent readers to a writer may see
ZEROs in the interim.

I still don't see how an application can use the fact that two writers
will not give them mixed records. And surly it does not work on a shared
FS. So I was really wondering if you know of any such app

Thanks
Boaz

>>
>>
>> Thanks
>> Boaz
> ---end quoted text---
> 

<Prev in Thread] Current Thread [Next in Thread>