Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-13 Thread Jan Kara
On Wed 12-08-15 07:48:22, Dave Chinner wrote: > On Tue, Aug 11, 2015 at 04:51:22PM +, Wilcox, Matthew R wrote: > > The race that you're not seeing is page fault vs page fault. Two > > threads each attempt to store a byte to different locations on the > > same page. With a read-mutex to exclud

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-12 Thread Boaz Harrosh
On 08/12/2015 12:48 AM, Dave Chinner wrote: > On Tue, Aug 11, 2015 at 04:51:22PM +, Wilcox, Matthew R wrote: >> The race that you're not seeing is page fault vs page fault. Two >> threads each attempt to store a byte to different locations on the >> same page. With a read-mutex to exclude tru

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-12 Thread Boaz Harrosh
On 08/11/2015 11:26 PM, Kirill A. Shutemov wrote: > On Tue, Aug 11, 2015 at 07:17:12PM +0300, Boaz Harrosh wrote: >> On 08/11/2015 06:28 PM, Kirill A. Shutemov wrote: >>> We also used lock_page() to make sure we shoot out all pages as we don't >>> exclude page faults during truncate. Consider this

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Dave Chinner
On Tue, Aug 11, 2015 at 04:51:22PM +, Wilcox, Matthew R wrote: > The race that you're not seeing is page fault vs page fault. Two > threads each attempt to store a byte to different locations on the > same page. With a read-mutex to exclude truncates, each thread > calls ->get_block. One of

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Kirill A. Shutemov
On Tue, Aug 11, 2015 at 07:17:12PM +0300, Boaz Harrosh wrote: > On 08/11/2015 06:28 PM, Kirill A. Shutemov wrote: > > We also used lock_page() to make sure we shoot out all pages as we don't > > exclude page faults during truncate. Consider this race: > > > > > > get_bloc

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Boaz Harrosh
l A. Shutemov; Andrew Morton; Wilcox, Matthew R; linux...@kvack.org; > linux-fsde...@vger.kernel.org; linux-kernel@vger.kernel.org; Davidlohr Bueso > Subject: Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock > > On 08/11/2015 04:50 PM, Jan Kara wrote: >> On Tue 11

RE: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Wilcox, Matthew R
riginal Message- From: Boaz Harrosh [mailto:b...@plexistor.com] Sent: Tuesday, August 11, 2015 7:31 AM To: Jan Kara; Dave Chinner Cc: Kirill A. Shutemov; Andrew Morton; Wilcox, Matthew R; linux...@kvack.org; linux-fsde...@vger.kernel.org; linux-kernel@vger.kernel.org; Davidlohr Bueso Subject

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Boaz Harrosh
On 08/11/2015 06:28 PM, Kirill A. Shutemov wrote: <> >> Hi Jan. So you got me confused above. You say: >> "DAX which needs exclusive access to the page given range in the page >> cache" >> >> but DAX and page-cache are mutually exclusive. I guess you meant the VMA >> range, or the inode->mapp

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Kirill A. Shutemov
On Tue, Aug 11, 2015 at 05:31:04PM +0300, Boaz Harrosh wrote: > On 08/11/2015 04:50 PM, Jan Kara wrote: > > On Tue 11-08-15 19:37:08, Dave Chinner wrote: > The patch below tries to recover some scalability for DAX by introducing > per-mapping range lock. > >>> > >>> So this grows noticeab

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Boaz Harrosh
On 08/11/2015 04:50 PM, Jan Kara wrote: > On Tue 11-08-15 19:37:08, Dave Chinner wrote: The patch below tries to recover some scalability for DAX by introducing per-mapping range lock. >>> >>> So this grows noticeably (3 longs if I'm right) struct address_space and >>> thus struct inode j

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Jan Kara
On Tue 11-08-15 19:37:08, Dave Chinner wrote: > > > The patch below tries to recover some scalability for DAX by introducing > > > per-mapping range lock. > > > > So this grows noticeably (3 longs if I'm right) struct address_space and > > thus struct inode just for DAX. That looks like a waste bu

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Kirill A. Shutemov
On Tue, Aug 11, 2015 at 07:37:08PM +1000, Dave Chinner wrote: > On Tue, Aug 11, 2015 at 10:19:09AM +0200, Jan Kara wrote: > > On Mon 10-08-15 18:14:24, Kirill A. Shutemov wrote: > > > As we don't have struct pages for DAX memory, Matthew had to find an > > > replacement for lock_page() to avoid fau

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Boaz Harrosh
On 08/11/2015 12:37 PM, Dave Chinner wrote: > On Tue, Aug 11, 2015 at 10:19:09AM +0200, Jan Kara wrote: >> On Mon 10-08-15 18:14:24, Kirill A. Shutemov wrote: >>> As we don't have struct pages for DAX memory, Matthew had to find an >>> replacement for lock_page() to avoid fault vs. truncate races.

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Dave Chinner
On Tue, Aug 11, 2015 at 10:19:09AM +0200, Jan Kara wrote: > On Mon 10-08-15 18:14:24, Kirill A. Shutemov wrote: > > As we don't have struct pages for DAX memory, Matthew had to find an > > replacement for lock_page() to avoid fault vs. truncate races. > > i_mmap_lock was used for that. > > > > Rec

Re: [PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-11 Thread Jan Kara
On Mon 10-08-15 18:14:24, Kirill A. Shutemov wrote: > As we don't have struct pages for DAX memory, Matthew had to find an > replacement for lock_page() to avoid fault vs. truncate races. > i_mmap_lock was used for that. > > Recently, Matthew had to convert locking to exclusive to address fault >

[PATCH, RFC 2/2] dax: use range_lock instead of i_mmap_lock

2015-08-10 Thread Kirill A. Shutemov
As we don't have struct pages for DAX memory, Matthew had to find an replacement for lock_page() to avoid fault vs. truncate races. i_mmap_lock was used for that. Recently, Matthew had to convert locking to exclusive to address fault vs. fault races. And this kills scalability completely. The pat