Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: Qu Wenruo <wqu@suse.com>, Christoph Hellwig <hch@infradead.org>,
	 linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	viro@zeniv.linux.org.uk,  Askar Safin <safinaskar@gmail.com>
Subject: Re: [PATCH RFC 2/2] fs: fully sync all fses even for an emergency sync
Date: Wed, 5 Nov 2025 12:32:44 +0100	[thread overview]
Message-ID: <20251105-libellen-genutzt-2133e1086dc5@brauner> (raw)
In-Reply-To: <l4nrvt3dxy3wstryugdevnjub6g6e4qzsrpnqpdb2xo5qidxh2@yxcosrvhx6rh>

On Tue, Nov 04, 2025 at 09:39:14AM +0100, Jan Kara wrote:
> On Tue 04-11-25 09:28:27, Jan Kara wrote:
> > On Tue 04-11-25 07:25:06, Qu Wenruo wrote:
> > > 
> > > 
> > > 在 2025/11/3 22:26, Christoph Hellwig 写道:
> > > > The emergency sync being non-blocking goes back to day 1.  I think the
> > > > idea behind it is to not lock up a already messed up system by
> > > > blocking forever, even if it is in workqueue.  Changing this feels
> > > > a bit risky to me.
> > > 
> > > Considering everything is already done in task context (baked by the global
> > > per-cpu workqueue), it at least won't block anything else.
> > > 
> > > And I'd say if the fs is already screwed up and hanging, the
> > > sync_inodes_one_sb() call are more likely to hang than the final sync_fs()
> > > call.
> > 
> > Well, but notice that sync_inodes_one_sb() is always called with wait == 0
> > from do_sync_work() exactly to skip inodes already marked as under
> > writeback, locked pages or pages under writeback as waiting for these has
> > high chances of locking up. Suddently calling sync_fs_one_sb() with wait ==
> > 1 can change things. That being said for ext4 the chances of locking up
> > ext4_sync_fs() with wait == 1 after sync_fs_one_sb() managed to do
> > non-trivial work are fairly minimal so I don't have strong objections
> > myself.
> 
> Ah, ok, now I've checked the code and read patch 1 in this thread. Indeed
> sync_inodes_one_sb() ignores the wait parameter and waits for everything.
> Given we've been running like this for over 10 years and nobody complained
> I agree calling sync_fs_one_sb() with wait == 1 is worth trying if it makes
> life better for btrfs.

Agreed. But emergency_sync() is really just a best-effort thing and I'm
rather weary accumulating complexity for it otherwise.

  reply	other threads:[~2025-11-05 11:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03  4:07 [PATCH RFC 0/2] fs: fully sync all fsese even for an emergency sync Qu Wenruo
2025-11-03  4:07 ` [PATCH RFC 1/2] fs: do not pass a parameter for sync_inodes_one_sb() Qu Wenruo
2025-11-03 11:51   ` Christoph Hellwig
2025-11-04  8:42     ` Jan Kara
2025-11-05 18:50       ` Daniel Vacek
2025-11-03  4:07 ` [PATCH RFC 2/2] fs: fully sync all fses even for an emergency sync Qu Wenruo
2025-11-03 11:56   ` Christoph Hellwig
2025-11-03 12:04     ` Christoph Hellwig
2025-11-03 20:46       ` Qu Wenruo
2025-11-03 20:55     ` Qu Wenruo
2025-11-04  8:28       ` Jan Kara
2025-11-04  8:39         ` Jan Kara
2025-11-05 11:32           ` Christian Brauner [this message]
2025-11-04  8:43         ` Qu Wenruo
2025-11-04 12:42           ` Jan Kara
2025-11-04 15:48             ` Christoph Hellwig
2025-11-03 16:00 ` [PATCH RFC 0/2] fs: fully sync all fsese " Askar Safin
2025-11-05 11:31 ` Christian Brauner

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=20251105-libellen-genutzt-2133e1086dc5@brauner \
    --to=brauner@kernel.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=safinaskar@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wqu@suse.com \
    /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