Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-15 Thread Ming Lei
On Tue, Oct 15, 2013 at 8:34 PM, Jan Kara wrote: > On Tue 15-10-13 19:15:56, Ming Lei wrote: >> > This won't quite work because if the page is fully mapped >> > mpage_process_page_bufs() will immediately submit the page and decrease >> > nr_to_write. So now you would end up writing less than you

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-15 Thread Jan Kara
On Tue 15-10-13 19:15:56, Ming Lei wrote: > > This won't quite work because if the page is fully mapped > > mpage_process_page_bufs() will immediately submit the page and decrease > > nr_to_write. So now you would end up writing less than you were asked for > > in some cases. > > Yes, your are

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-15 Thread Ming Lei
On Tue, 15 Oct 2013 12:39:00 +0200 Jan Kara wrote: > On Tue 15-10-13 10:25:53, Ming Lei wrote: > > Looks it makes sense, so how about below change? > > > > -- > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > > index 32c04ab..c32b599 100644 > > --- a/fs/ext4/inode.c > > +++ b/fs/ext4/inode.c

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-15 Thread Jan Kara
On Tue 15-10-13 10:25:53, Ming Lei wrote: > Looks it makes sense, so how about below change? > > -- > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 32c04ab..c32b599 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -2294,7 +2294,7 @@ static int mpage_prepare_extent_to_map(struct

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-14 Thread Ming Lei
On Mon, 14 Oct 2013 19:34:59 +0200 Jan Kara wrote: > On Mon 14-10-13 21:50:54, Ming Lei wrote: > > On Mon, Oct 14, 2013 at 8:58 PM, Jan Kara wrote: > > > Umm, I guess I see what are you pointing at. Thanks for catching that. > > > mpage_process_page_bufs() always adds a buffer to mpd even if n

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-14 Thread Jan Kara
On Mon 14-10-13 21:50:54, Ming Lei wrote: > On Mon, Oct 14, 2013 at 8:58 PM, Jan Kara wrote: > > Umm, I guess I see what are you pointing at. Thanks for catching that. > > mpage_process_page_bufs() always adds a buffer to mpd even if nr_to_write > > is already <= 0. But I would somewhat prefer n

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-14 Thread Ming Lei
On Mon, Oct 14, 2013 at 8:58 PM, Jan Kara wrote: > Umm, I guess I see what are you pointing at. Thanks for catching that. > mpage_process_page_bufs() always adds a buffer to mpd even if nr_to_write > is already <= 0. But I would somewhat prefer not to call > mpage_prepare_extent_to_map() at all

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-14 Thread Jan Kara
Hello, On Mon 14-10-13 00:39:52, Ming Lei wrote: > Commit 4e7ea81db5(ext4: restructure writeback path) introduces > another performance regression on random write: > > - one more page may be mapped to ext4 extent in mpage_prepare_extent_to_map, > and will be submitted for I/O so nr_to_write wil

Re: [PATCH] ext4: fix checking on nr_to_write

2013-10-13 Thread Ming Lei
On Mon, Oct 14, 2013 at 12:39 AM, Ming Lei wrote: > > On one arm A15 board(arndale) with sata 3.0 SSD(CPU: 1.5GHz dura core, RAM: > 2GB), Sorry for forgetting to mention: the sata controller is working at 3.0Gbps. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe

[PATCH] ext4: fix checking on nr_to_write

2013-10-13 Thread Ming Lei
Commit 4e7ea81db5(ext4: restructure writeback path) introduces another performance regression on random write: - one more page may be mapped to ext4 extent in mpage_prepare_extent_to_map, and will be submitted for I/O so nr_to_write will become -1 before 'done' is set - the worse thing is that di