Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-24 Thread Chris Mason
On 24 May 2018, at 4:46, robbieko wrote: Chris Mason 於 2018-05-23 23:56 寫到: On 23 May 2018, at 3:26, robbieko wrote: But we're not avoiding the inode lock completely, we're just dropping it for the expensive parts of writing to the file. A quick guess about what the expensive parts are: 1

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-24 Thread robbieko
Chris Mason 於 2018-05-23 23:56 寫到: On 23 May 2018, at 3:26, robbieko wrote: Chris Mason 於 2018-05-23 02:31 寫到: On 22 May 2018, at 14:08, Christoph Hellwig wrote: On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: From: Robbie Ko This idea is from direct io. By this patch, we can ma

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-23 Thread Chris Mason
On 23 May 2018, at 2:37, Christoph Hellwig wrote: On Tue, May 22, 2018 at 02:31:36PM -0400, Chris Mason wrote: And what protects two writes from interleaving their results now? page locks...ish, we at least won't have results interleaved in a single page. For btrfs it'll actually be multi

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-23 Thread Chris Mason
On 23 May 2018, at 3:26, robbieko wrote: Chris Mason 於 2018-05-23 02:31 寫到: On 22 May 2018, at 14:08, Christoph Hellwig wrote: On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: From: Robbie Ko This idea is from direct io. By this patch, we can make the buffered write parallel, and

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-23 Thread Nikolay Borisov
On 23.05.2018 09:37, Christoph Hellwig wrote: > On Tue, May 22, 2018 at 02:31:36PM -0400, Chris Mason wrote: >>> And what protects two writes from interleaving their results now? >> >> page locks...ish, we at least won't have results interleaved in a single >> page. For btrfs it'll actually be m

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-23 Thread robbieko
Chris Mason 於 2018-05-23 02:31 寫到: On 22 May 2018, at 14:08, Christoph Hellwig wrote: On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: From: Robbie Ko This idea is from direct io. By this patch, we can make the buffered write parallel, and improve the performance and latency. But be

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-23 Thread robbieko
Omar Sandoval 於 2018-05-23 01:28 寫到: On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: From: Robbie Ko This idea is from direct io. By this patch, we can make the buffered write parallel, and improve the performance and latency. But because we can not update isize without i_mutex, th

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-22 Thread Christoph Hellwig
On Tue, May 22, 2018 at 02:31:36PM -0400, Chris Mason wrote: > > And what protects two writes from interleaving their results now? > > page locks...ish, we at least won't have results interleaved in a single > page. For btrfs it'll actually be multiple pages since we try to do more > than one at

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-22 Thread Chris Mason
On 22 May 2018, at 14:08, Christoph Hellwig wrote: On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: From: Robbie Ko This idea is from direct io. By this patch, we can make the buffered write parallel, and improve the performance and latency. But because we can not update isize witho

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-22 Thread Christoph Hellwig
On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: > From: Robbie Ko > > This idea is from direct io. By this patch, we can make the buffered > write parallel, and improve the performance and latency. But because we > can not update isize without i_mutex, the unlocked buffered write just >

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-22 Thread David Sterba
On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: > From: Robbie Ko > > This idea is from direct io. By this patch, we can make the buffered > write parallel, and improve the performance and latency. But because we > can not update isize without i_mutex, the unlocked buffered write just >

Re: [PATCH] Btrfs: implement unlocked buffered write

2018-05-22 Thread Omar Sandoval
On Wed, May 16, 2018 at 11:52:37AM +0800, robbieko wrote: > From: Robbie Ko > > This idea is from direct io. By this patch, we can make the buffered > write parallel, and improve the performance and latency. But because we > can not update isize without i_mutex, the unlocked buffered write just >

[PATCH] Btrfs: implement unlocked buffered write

2018-05-15 Thread robbieko
From: Robbie Ko This idea is from direct io. By this patch, we can make the buffered write parallel, and improve the performance and latency. But because we can not update isize without i_mutex, the unlocked buffered write just can be done in front of the EOF. We needn't worry about the race bet