From: Jens Axboe <jens.axboe@oracle.com>
To: Theodore Tso <tytso@mit.edu>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-mm@kvack.org,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, chris.mason@oracle.com
Subject: Re: [PATCH, RFC] vm: Add an tuning knob for vm.max_writeback_pages
Date: Mon, 31 Aug 2009 12:47:49 +0200 [thread overview]
Message-ID: <20090831104748.GT12579@kernel.dk> (raw)
In-Reply-To: <20090831102909.GS12579@kernel.dk>
On Mon, Aug 31 2009, Jens Axboe wrote:
> > I traced the calls to ext4_da_writepages() using ftrace, and found this:
> >
> > flush-8:16-1829 [001] 23.416351: ext4_da_writepages: dev sdb ino 12 nr_t_write 32759 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 25.939354: ext4_da_writepages: dev sdb ino 12 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 25.939486: ext4_da_writepages: dev sdb ino 13 nr_t_write 32759 pages_skipped 0 range_start 134180864 range_end 9223372036854775807 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.055687: ext4_da_writepages: dev sdb ino 12 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.055691: ext4_da_writepages: dev sdb ino 13 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.878708: ext4_da_writepages: dev sdb ino 13 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> >
> > The *first* time the per-bdi code called writepages on the second file
> > (test2, inode #13), range_start was 134180864 (which, curiously
> > enough, is 4096*32759, which was the value of nr_to_write passed to
> > ext4_da_writepages). Given that the inode only had 32768 pages, the
> > fact that apparently *some* codepath called ext4_da_writepages
> > starting at logical block 32759, with nr_to_write set to 32759, seems
> > very curious indeed. That doesn't seem right at all. It's late, so I
> > won't try to trace it down now; plus which it's your code so I figure
> > you can probably figure it out faster....
>
> Interesting, needs checking up on. I've prepared a v14 patchset today,
> perhaps (if you have time), you can see if it reproduces there? I'm
> running some performance tests today, but will make a note to look into
> this after that.
It's because ext4 writepages sets ->range_start and wb_writeback() is
range cyclic, then the next iteration will have the previous end point
as the starting point. Looks like we need to clear ->range_start in
wb_writeback(), the better place is probably to do that in
fs/fs-writeback.c:generic_sync_wb_inodes() right after the
writeback_single_inode() call. This, btw, should be no different than
the current code, weird/correct or not :-)
--
Jens Axboe
WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <jens.axboe@oracle.com>
To: Theodore Tso <tytso@mit.edu>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-mm@kvack.org,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, chris.mason@oracle.com
Subject: Re: [PATCH, RFC] vm: Add an tuning knob for vm.max_writeback_pages
Date: Mon, 31 Aug 2009 12:47:49 +0200 [thread overview]
Message-ID: <20090831104748.GT12579@kernel.dk> (raw)
In-Reply-To: <20090831102909.GS12579@kernel.dk>
On Mon, Aug 31 2009, Jens Axboe wrote:
> > I traced the calls to ext4_da_writepages() using ftrace, and found this:
> >
> > flush-8:16-1829 [001] 23.416351: ext4_da_writepages: dev sdb ino 12 nr_t_write 32759 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 25.939354: ext4_da_writepages: dev sdb ino 12 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 25.939486: ext4_da_writepages: dev sdb ino 13 nr_t_write 32759 pages_skipped 0 range_start 134180864 range_end 9223372036854775807 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.055687: ext4_da_writepages: dev sdb ino 12 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.055691: ext4_da_writepages: dev sdb ino 13 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> > flush-8:16-1829 [000] 27.878708: ext4_da_writepages: dev sdb ino 13 nr_t_write 32768 pages_skipped 0 range_start 0 range_end 0 nonblocking 0 for_kupdate 0 for_reclaim 0 for_writepages 1 range_cyclic 1
> >
> > The *first* time the per-bdi code called writepages on the second file
> > (test2, inode #13), range_start was 134180864 (which, curiously
> > enough, is 4096*32759, which was the value of nr_to_write passed to
> > ext4_da_writepages). Given that the inode only had 32768 pages, the
> > fact that apparently *some* codepath called ext4_da_writepages
> > starting at logical block 32759, with nr_to_write set to 32759, seems
> > very curious indeed. That doesn't seem right at all. It's late, so I
> > won't try to trace it down now; plus which it's your code so I figure
> > you can probably figure it out faster....
>
> Interesting, needs checking up on. I've prepared a v14 patchset today,
> perhaps (if you have time), you can see if it reproduces there? I'm
> running some performance tests today, but will make a note to look into
> this after that.
It's because ext4 writepages sets ->range_start and wb_writeback() is
range cyclic, then the next iteration will have the previous end point
as the starting point. Looks like we need to clear ->range_start in
wb_writeback(), the better place is probably to do that in
fs/fs-writeback.c:generic_sync_wb_inodes() right after the
writeback_single_inode() call. This, btw, should be no different than
the current code, weird/correct or not :-)
--
Jens Axboe
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-08-31 10:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-30 2:54 [PATCH, RFC] vm: Add an tuning knob for vm.max_writeback_pages Theodore Ts'o
2009-08-30 2:54 ` Theodore Ts'o
2009-08-30 16:52 ` Christoph Hellwig
2009-08-30 16:52 ` Christoph Hellwig
2009-08-30 18:17 ` Theodore Tso
2009-08-30 18:17 ` Theodore Tso
2009-08-30 22:27 ` Christoph Hellwig
2009-08-30 22:27 ` Christoph Hellwig
2009-08-31 3:08 ` Theodore Tso
2009-08-31 3:08 ` Theodore Tso
2009-08-31 10:29 ` Jens Axboe
2009-08-31 10:29 ` Jens Axboe
2009-08-31 10:47 ` Jens Axboe [this message]
2009-08-31 10:47 ` Jens Axboe
2009-08-31 12:37 ` Theodore Tso
2009-08-31 12:37 ` Theodore Tso
2009-08-31 15:54 ` Theodore Tso
2009-08-31 20:36 ` Jens Axboe
2009-08-31 21:03 ` Theodore Tso
2009-09-01 7:57 ` Aneesh Kumar K.V
2009-09-01 9:17 ` Jens Axboe
2009-09-01 18:00 ` Chris Mason
2009-09-01 20:30 ` Theodore Tso
2009-09-01 20:30 ` Theodore Tso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090831104748.GT12579@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=chris.mason@oracle.com \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.