linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: small writeback fixes
Date: Tue, 18 Jul 2023 13:17:44 -0400	[thread overview]
Message-ID: <20230718171744.GA843162@perftesting> (raw)
In-Reply-To: <20230713130431.4798-1-hch@lst.de>

On Thu, Jul 13, 2023 at 03:04:22PM +0200, Christoph Hellwig wrote:
> Hi all,
> 
> this series has various fixes for bugs found in inspect or only triggered
> with upcoming changes that are a fallout from my work on bound lifetimes
> for the ordered extent and better confirming to expectations from the
> common writeback code.
> 
> Note that this series builds on the "btrfs compressed writeback cleanups"
> series sent out previously.
> 
> A git tree is also available here:
> 
>     git://git.infradead.org/users/hch/misc.git btrfs-writeback-fixes
> 
> Gitweb:
> 
>     http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/btrfs-writeback-fixes
> 
> Diffatat:
>  extent_io.c |  182 ++++++++++++++++++++++++++++++++++++------------------------
>  inode.c     |   16 +----
>  2 files changed, 117 insertions(+), 81 deletions(-)

Just FYI I've been using these two series to see how the github CI stuff was
working, and I keep tripping over a hang in generic/475.  It appears to be in
the fixup worker, here's the sysrq w output

sysrq: Show Blocked State
task:kworker/u4:5    state:D stack:0     pid:1713600 ppid:2      flags:0x00004000
Workqueue: btrfs-fixup btrfs_work_helper
Call Trace:
 <TASK>
 __schedule+0x533/0x1910
 ? find_held_lock+0x2b/0x80
 schedule+0x5e/0xd0
 __reserve_bytes+0x4e2/0x830
 ? __pfx_autoremove_wake_function+0x10/0x10
 btrfs_reserve_data_bytes+0x54/0x170
 btrfs_check_data_free_space+0x6a/0xf0
 btrfs_delalloc_reserve_space+0x2b/0xe0
 btrfs_writepage_fixup_worker+0x7e/0x4c0
 btrfs_work_helper+0xff/0x410
 process_one_work+0x26b/0x550
 worker_thread+0x53/0x3a0
 ? __pfx_worker_thread+0x10/0x10
 kthread+0xf5/0x130
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x2c/0x50
 </TASK>
task:kworker/u4:4    state:D stack:0     pid:2513631 ppid:2      flags:0x00004000
Workqueue: events_unbound btrfs_async_reclaim_data_space
Call Trace:
 <TASK>
 __schedule+0x533/0x1910
 ? lock_acquire+0xca/0x2b0
 schedule+0x5e/0xd0
 schedule_timeout+0x1ad/0x1c0
 __wait_for_common+0xbd/0x220
 ? __pfx_schedule_timeout+0x10/0x10
 btrfs_wait_ordered_extents+0x3e3/0x480
 btrfs_wait_ordered_roots+0x184/0x260
 flush_space+0x3de/0x6a0
 ? btrfs_async_reclaim_data_space+0x52/0x180
 ? lock_release+0xc9/0x270
 btrfs_async_reclaim_data_space+0xff/0x180
 process_one_work+0x26b/0x550
 worker_thread+0x1eb/0x3a0
 ? __pfx_worker_thread+0x10/0x10
 kthread+0xf5/0x130
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x2c/0x50
 </TASK>
task:kworker/u4:6    state:D stack:0     pid:2513783 ppid:2      flags:0x00004000
Workqueue: btrfs-flush_delalloc btrfs_work_helper
Call Trace:
 <TASK>
 __schedule+0x533/0x1910
 schedule+0x5e/0xd0
 btrfs_start_ordered_extent+0x153/0x210
 ? __pfx_autoremove_wake_function+0x10/0x10
 btrfs_run_ordered_extent_work+0x19/0x30
 btrfs_work_helper+0xff/0x410
 process_one_work+0x26b/0x550
 worker_thread+0x53/0x3a0
 ? __pfx_worker_thread+0x10/0x10
 kthread+0xf5/0x130
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x2c/0x50
 </TASK>

We appear to be getting hung up because the ENOSPC stuff is flushing and waiting
on ordered extents, and then the fixup worker is waiting on trying to reserve
space.  My hunch is the page that's in the fixup worker is attached to an
ordered extent.

I can pretty reliably reproduce this in the CI, so if you have trouble
reproducing it let me know.  I'll dig into it later today, but I may not get to
it before you do.  Thanks,

Josef

  parent reply	other threads:[~2023-07-18 17:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:04 small writeback fixes Christoph Hellwig
2023-07-13 13:04 ` [PATCH 1/9] btrfs: don't stop integrity writeback too early Christoph Hellwig
2023-07-13 13:04 ` [PATCH 2/9] btrfs: don't wait for writeback on clean pages in extent_write_cache_pages Christoph Hellwig
2023-07-13 13:04 ` [PATCH 3/9] btrfs: fix an error handling corner case in cow_file_range Christoph Hellwig
2023-07-13 13:04 ` [PATCH 4/9] btrfs: move the cow_fixup earlier in writepages handling Christoph Hellwig
2023-07-13 13:04 ` [PATCH 5/9] btrfs: fix handling of errors from __extent_writepage_io Christoph Hellwig
2023-07-13 13:04 ` [PATCH 6/9] btrfs: stop submitting I/O after an error in extent_write_locked_range Christoph Hellwig
2023-07-13 13:04 ` [PATCH 7/9] btrfs: fix a race in clearing the writeback bit for sub-page I/O Christoph Hellwig
2023-07-13 13:04 ` [PATCH 8/9] btrfs: remove the call to btrfs_mark_ordered_io_finished in btrfs_writepage_fixup_worker Christoph Hellwig
2023-07-13 13:04 ` [PATCH 9/9] btrfs: lift the call to mapping_set_error out of cow_file_range Christoph Hellwig
2023-07-14 13:59 ` small writeback fixes Josef Bacik
2023-07-18 17:17 ` Josef Bacik [this message]
2023-07-19  5:39   ` Christoph Hellwig
2023-07-19 11:50     ` Christoph Hellwig
2023-07-19 14:30       ` Josef Bacik
2023-07-19 15:25         ` Christoph Hellwig
2023-07-19 21:42       ` Josef Bacik
2023-07-20  4:48         ` Christoph Hellwig

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=20230718171744.GA843162@perftesting \
    --to=josef@toxicpanda.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).