Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1207214 > unrolled thread
| Started by | Tejun Heo <tj@kernel.org> |
|---|---|
| First post | 2015-08-14 00:50 +0200 |
| Last post | 2015-08-19 00:00 +0200 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Tejun Heo <tj@kernel.org> - 2015-08-14 00:50 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Jan Kara <jack@suse.cz> - 2015-08-14 13:20 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Damien Wyart <damien.wyart@gmail.com> - 2015-08-14 17:30 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Tejun Heo <tj@kernel.org> - 2015-08-17 22:10 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Damien Wyart <damien.wyart@gmail.com> - 2015-08-18 07:40 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Tejun Heo <tj@kernel.org> - 2015-08-17 22:10 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Jan Kara <jack@suse.cz> - 2015-08-18 11:20 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Tejun Heo <tj@kernel.org> - 2015-08-18 19:50 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Tejun Heo <tj@kernel.org> - 2015-08-18 22:00 +0200
Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes Dave Chinner <david@fromorbit.com> - 2015-08-19 00:00 +0200
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-08-14 00:50 +0200 |
| Subject | [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pX9tT-ep-7@gated-at.bofh.it> |
e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
updated writeback path to avoid kicking writeback work items if there
are no inodes to be written out; unfortunately, the avoidance logic
was too aggressive and made sync_inodes_sb() skip I_DIRTY_TIME inodes.
This patch fixes the breakage by
* Removing bdi_has_dirty_io() shortcut from bdi_split_work_to_wbs().
The callers are already testing the condition.
* Removing bdi_has_dirty_io() shortcut from sync_inodes_sb() so that
it always calls into bdi_split_work_to_wbs().
* Making bdi_split_work_to_wbs() consider the b_dirty_time list for
WB_SYNC_ALL writebacks.
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
Cc: Ted Ts'o <tytso@google.com>
Cc: Jan Kara <jack@suse.com>
---
Hello,
So, this fixes I_DIRTY_TIME syncing problem for ext4 but AFAICS xfs
doesn't even use the generic inode metadata writeback path, so this
most likely won't do anything for the originally reported problem.
I'll post another patch for debugging.
Thanks.
fs/fs-writeback.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -844,14 +844,15 @@ static void bdi_split_work_to_wbs(struct
struct wb_iter iter;
might_sleep();
-
- if (!bdi_has_dirty_io(bdi))
- return;
restart:
rcu_read_lock();
bdi_for_each_wb(wb, bdi, &iter, next_blkcg_id) {
- if (!wb_has_dirty_io(wb) ||
- (skip_if_busy && writeback_in_progress(wb)))
+ /* SYNC_ALL writes out I_DIRTY_TIME too */
+ if (!wb_has_dirty_io(wb) &&
+ (base_work->sync_mode == WB_SYNC_NONE ||
+ list_empty(&wb->b_dirty_time)))
+ continue;
+ if (skip_if_busy && writeback_in_progress(wb))
continue;
base_work->nr_pages = wb_split_bdi_pages(wb, nr_pages);
@@ -899,8 +900,7 @@ static void bdi_split_work_to_wbs(struct
{
might_sleep();
- if (bdi_has_dirty_io(bdi) &&
- (!skip_if_busy || !writeback_in_progress(&bdi->wb))) {
+ if (!skip_if_busy || !writeback_in_progress(&bdi->wb)) {
base_work->auto_free = 0;
base_work->single_wait = 0;
base_work->single_done = 0;
@@ -2275,8 +2275,8 @@ void sync_inodes_sb(struct super_block *
};
struct backing_dev_info *bdi = sb->s_bdi;
- /* Nothing to do? */
- if (!bdi_has_dirty_io(bdi) || bdi == &noop_backing_dev_info)
+ /* bdi_has_dirty() ignores I_DIRTY_TIME but we can't, always kick wbs */
+ if (bdi == &noop_backing_dev_info)
return;
WARN_ON(!rwsem_is_locked(&sb->s_umount));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2015-08-14 13:20 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pXlbH-rr-1@gated-at.bofh.it> |
| In reply to | #1207214 |
Hello,
On Thu 13-08-15 18:44:15, Tejun Heo wrote:
> e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
> updated writeback path to avoid kicking writeback work items if there
> are no inodes to be written out; unfortunately, the avoidance logic
> was too aggressive and made sync_inodes_sb() skip I_DIRTY_TIME inodes.
> This patch fixes the breakage by
>
> * Removing bdi_has_dirty_io() shortcut from bdi_split_work_to_wbs().
> The callers are already testing the condition.
>
> * Removing bdi_has_dirty_io() shortcut from sync_inodes_sb() so that
> it always calls into bdi_split_work_to_wbs().
>
> * Making bdi_split_work_to_wbs() consider the b_dirty_time list for
> WB_SYNC_ALL writebacks.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Fixes: e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
> Cc: Ted Ts'o <tytso@google.com>
> Cc: Jan Kara <jack@suse.com>
So the patch looks good to me. But the fact that is fixes Eryu's problem
means there is something fishy going on. Either inodes get wrongly attached
to b_dirty_time list or bdi_has_dirty_io() somehow misbehaves only
temporarily and we don't catch it with the debug patch.
Can we add a test to wb_has_dirty_io() to also check whether it matches
bdi_has_dirty_io()? Since Eryu doesn't use lazytime (I assume, Eryu, please
speak up if you do), we could also warn if b_dirty_time lists get
non-empty. Hmm?
Honza
> ---
> Hello,
>
> So, this fixes I_DIRTY_TIME syncing problem for ext4 but AFAICS xfs
> doesn't even use the generic inode metadata writeback path, so this
> most likely won't do anything for the originally reported problem.
> I'll post another patch for debugging.
>
> Thanks.
>
> fs/fs-writeback.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -844,14 +844,15 @@ static void bdi_split_work_to_wbs(struct
> struct wb_iter iter;
>
> might_sleep();
> -
> - if (!bdi_has_dirty_io(bdi))
> - return;
> restart:
> rcu_read_lock();
> bdi_for_each_wb(wb, bdi, &iter, next_blkcg_id) {
> - if (!wb_has_dirty_io(wb) ||
> - (skip_if_busy && writeback_in_progress(wb)))
> + /* SYNC_ALL writes out I_DIRTY_TIME too */
> + if (!wb_has_dirty_io(wb) &&
> + (base_work->sync_mode == WB_SYNC_NONE ||
> + list_empty(&wb->b_dirty_time)))
> + continue;
> + if (skip_if_busy && writeback_in_progress(wb))
> continue;
>
> base_work->nr_pages = wb_split_bdi_pages(wb, nr_pages);
> @@ -899,8 +900,7 @@ static void bdi_split_work_to_wbs(struct
> {
> might_sleep();
>
> - if (bdi_has_dirty_io(bdi) &&
> - (!skip_if_busy || !writeback_in_progress(&bdi->wb))) {
> + if (!skip_if_busy || !writeback_in_progress(&bdi->wb)) {
> base_work->auto_free = 0;
> base_work->single_wait = 0;
> base_work->single_done = 0;
> @@ -2275,8 +2275,8 @@ void sync_inodes_sb(struct super_block *
> };
> struct backing_dev_info *bdi = sb->s_bdi;
>
> - /* Nothing to do? */
> - if (!bdi_has_dirty_io(bdi) || bdi == &noop_backing_dev_info)
> + /* bdi_has_dirty() ignores I_DIRTY_TIME but we can't, always kick wbs */
> + if (bdi == &noop_backing_dev_info)
> return;
> WARN_ON(!rwsem_is_locked(&sb->s_umount));
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Damien Wyart <damien.wyart@gmail.com> |
|---|---|
| Date | 2015-08-14 17:30 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pXp5E-5Zq-9@gated-at.bofh.it> |
| In reply to | #1207494 |
> On Thu 13-08-15 18:44:15, Tejun Heo wrote:
> > e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
> > updated writeback path to avoid kicking writeback work items if there
> > are no inodes to be written out; unfortunately, the avoidance logic
> > was too aggressive and made sync_inodes_sb() skip I_DIRTY_TIME inodes.
> > This patch fixes the breakage by
> > * Removing bdi_has_dirty_io() shortcut from bdi_split_work_to_wbs().
> > The callers are already testing the condition.
> > * Removing bdi_has_dirty_io() shortcut from sync_inodes_sb() so that
> > it always calls into bdi_split_work_to_wbs().
> > * Making bdi_split_work_to_wbs() consider the b_dirty_time list for
> > WB_SYNC_ALL writebacks.
> > Signed-off-by: Tejun Heo <tj@kernel.org>
> > Fixes: e79729123f63 ("writeback: don't issue wb_writeback_work if clean")
> > Cc: Ted Ts'o <tytso@google.com>
> > Cc: Jan Kara <jack@suse.com>
* Jan Kara <jack@suse.cz> [2015-08-14 13:14]:
> So the patch looks good to me. But the fact that is fixes Eryu's problem
> means there is something fishy going on. Either inodes get wrongly attached
> to b_dirty_time list or bdi_has_dirty_io() somehow misbehaves only
> temporarily and we don't catch it with the debug patch.
> Can we add a test to wb_has_dirty_io() to also check whether it matches
> bdi_has_dirty_io()? Since Eryu doesn't use lazytime (I assume, Eryu, please
> speak up if you do), we could also warn if b_dirty_time lists get
> non-empty. Hmm?
Hi,
I had an unstable system when running latest Linus tree with Tejun's
patch applied on top. Nothing fishy in the logs after rebooting without
the patch, but remote access with ssh when patch applied did not work
(as if /home partition could not be read). This system has / as ext4 and
other partitions (including /home) as XFS. Trying to login on tty
instead of X resulted in hang of X. I could reboot with sysrq, but can't
do further tests at the moment.
Back to same tree without the patch resulted in normal system.
So just a heads up the patch doesn't seem OK in its current state.
Cheers
Damien
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-08-17 22:10 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYyTf-Mb-5@gated-at.bofh.it> |
| In reply to | #1207578 |
Hello, Damien. On Fri, Aug 14, 2015 at 05:14:01PM +0200, Damien Wyart wrote: > I had an unstable system when running latest Linus tree with Tejun's > patch applied on top. Nothing fishy in the logs after rebooting without > the patch, but remote access with ssh when patch applied did not work > (as if /home partition could not be read). This system has / as ext4 and > other partitions (including /home) as XFS. Trying to login on tty > instead of X resulted in hang of X. I could reboot with sysrq, but can't > do further tests at the moment. > > Back to same tree without the patch resulted in normal system. > > So just a heads up the patch doesn't seem OK in its current state. Have you been able to reproduce the failure? That sounds like an unlikely failure mode for the patch. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Damien Wyart <damien.wyart@gmail.com> |
|---|---|
| Date | 2015-08-18 07:40 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYHMR-5fD-5@gated-at.bofh.it> |
| In reply to | #1208852 |
> > I had an unstable system when running latest Linus tree with Tejun's > > patch applied on top. Nothing fishy in the logs after rebooting without > > the patch, but remote access with ssh when patch applied did not work > > (as if /home partition could not be read). This system has / as ext4 and > > other partitions (including /home) as XFS. Trying to login on tty > > instead of X resulted in hang of X. I could reboot with sysrq, but can't > > do further tests at the moment. > > Back to same tree without the patch resulted in normal system. > > So just a heads up the patch doesn't seem OK in its current state. Hi Tejun, > Have you been able to reproduce the failure? That sounds like an > unlikely failure mode for the patch. Unfortunately (as it would be nice to understand what happened), no. I reapplied the patch on top of rc7 and could not reproduce the unstability after several reboots. I will continue running with the patch and report if anything strange appears again... -- Damien -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-08-17 22:10 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYyTg-Mb-35@gated-at.bofh.it> |
| In reply to | #1207494 |
Hello, Jan. On Fri, Aug 14, 2015 at 01:14:09PM +0200, Jan Kara wrote: > So the patch looks good to me. But the fact that is fixes Eryu's problem > means there is something fishy going on. Either inodes get wrongly attached Seriously, it shouldn't affect size syncing or xfs but then again my understanding of xfs is severely limited. > to b_dirty_time list or bdi_has_dirty_io() somehow misbehaves only > temporarily and we don't catch it with the debug patch. > > Can we add a test to wb_has_dirty_io() to also check whether it matches > bdi_has_dirty_io()? Since Eryu doesn't use lazytime (I assume, Eryu, please > speak up if you do), we could also warn if b_dirty_time lists get > non-empty. Hmm? Sure, will prep a patch soon. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2015-08-18 11:20 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYLdM-1Qz-17@gated-at.bofh.it> |
| In reply to | #1208859 |
On Mon 17-08-15 16:02:54, Tejun Heo wrote: > Hello, Jan. > > On Fri, Aug 14, 2015 at 01:14:09PM +0200, Jan Kara wrote: > > So the patch looks good to me. But the fact that is fixes Eryu's problem > > means there is something fishy going on. Either inodes get wrongly attached > > Seriously, it shouldn't affect size syncing or xfs but then again my > understanding of xfs is severely limited. Well, i_size == 0 in XFS usually means that writeback didn't get to flushing delay allocated pages - inode size on disk gets increased only after the pages are written out in ->end_io callback. So at least this part makes some sense to me. Honza -- Jan Kara <jack@suse.com> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-08-18 19:50 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYTbk-4Se-25@gated-at.bofh.it> |
| In reply to | #1209149 |
On Tue, Aug 18, 2015 at 11:16:03AM +0200, Jan Kara wrote: > On Mon 17-08-15 16:02:54, Tejun Heo wrote: > > Hello, Jan. > > > > On Fri, Aug 14, 2015 at 01:14:09PM +0200, Jan Kara wrote: > > > So the patch looks good to me. But the fact that is fixes Eryu's problem > > > means there is something fishy going on. Either inodes get wrongly attached > > > > Seriously, it shouldn't affect size syncing or xfs but then again my > > understanding of xfs is severely limited. > > Well, i_size == 0 in XFS usually means that writeback didn't get to > flushing delay allocated pages - inode size on disk gets increased only > after the pages are written out in ->end_io callback. So at least this part > makes some sense to me. Hmm... the only possibility I can think of is tot_write_bandwidth being zero when it shouldn't be. I've been staring at the code for a while now but nothing rings a bell. Time for another debug patch, I guess. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-08-18 22:00 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYVd7-7KG-9@gated-at.bofh.it> |
| In reply to | #1209410 |
Hello, On Tue, Aug 18, 2015 at 10:47:18AM -0700, Tejun Heo wrote: > Hmm... the only possibility I can think of is tot_write_bandwidth > being zero when it shouldn't be. I've been staring at the code for a > while now but nothing rings a bell. Time for another debug patch, I > guess. So, I can now reproduce the bug (it takes a lot of trials but lowering the number of tested files helps quite a bit) and instrumented all the early exit paths w/o the fix patch. bdi_has_dirty_io() and wb_has_dirty_io() are never out of sync with the actual dirty / io lists even when the test 048 fails, so the bug at least is not caused by writeback skipping due to buggy bdi/wb_has_dirty_io() result. Whenever it skips, all the lists are actually empty (verified while holding list_lock). One suspicion I have is that this could be a subtle timing issue which is being exposed by the new short-cut path. Anything which adds delay seems to make the issue go away. Dave, does anything ring a bell? As for the proposed I_DIRTY_TIME fix, I think it'd be a good idea to merge it. It fixes a clear brekage regardless of this xfs issue. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Chinner <david@fromorbit.com> |
|---|---|
| Date | 2015-08-19 00:00 +0200 |
| Subject | Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes |
| Message-ID | <pYX5f-2Dz-9@gated-at.bofh.it> |
| In reply to | #1209452 |
On Tue, Aug 18, 2015 at 12:54:39PM -0700, Tejun Heo wrote: > Hello, > > On Tue, Aug 18, 2015 at 10:47:18AM -0700, Tejun Heo wrote: > > Hmm... the only possibility I can think of is tot_write_bandwidth > > being zero when it shouldn't be. I've been staring at the code for a > > while now but nothing rings a bell. Time for another debug patch, I > > guess. > > So, I can now reproduce the bug (it takes a lot of trials but lowering > the number of tested files helps quite a bit) and instrumented all the > early exit paths w/o the fix patch. bdi_has_dirty_io() and > wb_has_dirty_io() are never out of sync with the actual dirty / io > lists even when the test 048 fails, so the bug at least is not caused > by writeback skipping due to buggy bdi/wb_has_dirty_io() result. > Whenever it skips, all the lists are actually empty (verified while > holding list_lock). > > One suspicion I have is that this could be a subtle timing issue which > is being exposed by the new short-cut path. Anything which adds delay > seems to make the issue go away. Dave, does anything ring a bell? No, it doesn't. The data writeback mechanisms XFS uses are all generic. It marks inodes I_DIRTY_PAGES and lets the generic code take care of everything else. Yes, we do delayed allocation during writeback, and we log the inode size updates during IO completion, so if inode sizes are not getting updated, then Occam's Razor suggests that writeback is not happening. I'd suggest looking at some of the XFS tracepoints during the test: tracepoint trigger xfs_file_buffered_write once per write syscall xfs_file_sync once per fsync per inode xfs_vm_writepage every ->writepage call xfs_setfilesize every IO completion that updates inode size And it's probably best to also include all the writeback tracepoints, too, for context. That will tell you what inodes and what part of them are getting written back and when.... Cheers, Dave. -- Dave Chinner david@fromorbit.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web