From: "Theodore Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
brauner@kernel.org, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, riel@surriel.com, hannes@cmpxchg.org,
oliver.sang@intel.com, david@redhat.com, axboe@kernel.dk,
hare@suse.de, david@fromorbit.com, djwong@kernel.org,
ritesh.list@gmail.com, linux-fsdevel@vger.kernel.org,
linux-block@vger.kernel.org, linux-mm@kvack.org,
gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com
Subject: Re: [PATCH 2/3] fs/buffer: avoid races with folio migrations on __find_get_block_slow()
Date: Thu, 3 Apr 2025 12:11:53 -0400 [thread overview]
Message-ID: <20250403161153.GA3051250@mit.edu> (raw)
In-Reply-To: <2jrcw4mtwcophanqmi2y74ffgf247m6ap44u3gedpylsjl3bz6@yueuwkmcwm66>
On Thu, Apr 03, 2025 at 03:43:12PM +0200, Jan Kara wrote:
> fs/ext4/ialloc.c:recently_deleted() - this one is the most problematic
> place. It must bail rather than sleeping (called under a spinlock) but
> it depends on the fact that if bh is not returned, then the data has been
> written out and evicted from memory. Luckily, the usage of
> recently_deleted() is mostly an optimization to reduce damage in case
> of crash so rare false failure should be OK. Ted, what is your opinion?
Yes, if we can just assume that inode has not been recently deleted in
the rare case where a miogration is taking place, that should be fine.
So in practice, recently_deleted() could just call some variant of
find_get_block() (with some flag ) which returns NULL if we need to
sleep (e.g., if it is not in the buffer cache so a read would need to
take place, or we need to wait for the page migration to complete),
that should work fine.
Thanks,
- Ted
next prev parent reply other threads:[~2025-04-03 16:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-30 6:47 [PATCH 0/3] mm: move migration work around to buffer-heads Luis Chamberlain
2025-03-30 6:47 ` [PATCH 1/3] mm/migrate: add might_sleep() on __migrate_folio() Luis Chamberlain
2025-03-30 12:04 ` Matthew Wilcox
2025-03-31 6:28 ` Luis Chamberlain
2025-04-01 22:53 ` Davidlohr Bueso
2025-03-30 6:47 ` [PATCH 2/3] fs/buffer: avoid races with folio migrations on __find_get_block_slow() Luis Chamberlain
2025-03-31 19:58 ` Luis Chamberlain
2025-04-02 23:11 ` Luis Chamberlain
2025-04-04 15:55 ` Luis Chamberlain
2025-04-01 10:57 ` Jan Kara
2025-04-01 21:49 ` Davidlohr Bueso
2025-04-02 1:58 ` Matthew Wilcox
2025-04-03 2:04 ` Luis Chamberlain
2025-04-03 13:43 ` Jan Kara
2025-04-03 16:11 ` Theodore Ts'o [this message]
2025-04-03 1:02 ` Luis Chamberlain
2025-03-30 6:47 ` [PATCH 3/3] mm/migrate: avoid atomic context on buffer_migrate_folio_norefs() migration Luis Chamberlain
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=20250403161153.GA3051250@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=da.gomez@samsung.com \
--cc=david@fromorbit.com \
--cc=david@redhat.com \
--cc=djwong@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hannes@cmpxchg.org \
--cc=hare@suse.de \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=oliver.sang@intel.com \
--cc=p.raghav@samsung.com \
--cc=riel@surriel.com \
--cc=ritesh.list@gmail.com \
--cc=willy@infradead.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).