From: Joanne Koong <joannelkoong@gmail.com>
To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org
Cc: shakeel.butt@linux.dev, jefflexu@linux.alibaba.com,
josef@toxicpanda.com, linux-mm@kvack.org,
bernd.schubert@fastmail.fm, kernel-team@meta.com
Subject: Re: [PATCH v3 5/6] mm/migrate: fail MIGRATE_SYNC for folios under writeback with AS_WRITEBACK_MAY_BLOCK mappings
Date: Thu, 7 Nov 2024 11:22:06 -0800 [thread overview]
Message-ID: <CAJnrk1YGqrssNGa6hzyd==LmfdJ2-TN86ofrHWi+9HLfDidDfw@mail.gmail.com> (raw)
In-Reply-To: <20241107191618.2011146-6-joannelkoong@gmail.com>
On Thu, Nov 7, 2024 at 11:17 AM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> For folios with mappings that have the AS_WRITEBACK_MAY_BLOCK flag set
> on it, fail MIGRATE_SYNC mode migration with -EBUSY if the folio is
> currently under writeback. If the AS_WRITEBACK_MAY_BLOCK flag is set on
> the mapping, the writeback may take an indeterminate amount of time to
> complete, so we cannot wait on writeback.
Please ignore this patch (i meant to delete it from my local repo but
forgot before submitting) - it is superseded by
https://lore.kernel.org/linux-fsdevel/20241107191618.2011146-7-joannelkoong@gmail.com/T/#u,
which is the same change but has a more correct commit message. The
migration is skipped (see migrate_pages_batch() logic), not failed.
Thanks,
Joanne
>
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---
> mm/migrate.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index df91248755e4..1d038a4202ae 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1260,7 +1260,10 @@ static int migrate_folio_unmap(new_folio_t get_new_folio,
> */
> switch (mode) {
> case MIGRATE_SYNC:
> - break;
> + if (!src->mapping ||
> + !mapping_writeback_may_block(src->mapping))
> + break;
> + fallthrough;
> default:
> rc = -EBUSY;
> goto out;
> --
> 2.43.5
>
next prev parent reply other threads:[~2024-11-07 19:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 19:16 [PATCH v3 0/6] fuse: remove temp page copies in writeback Joanne Koong
2024-11-07 19:16 ` [PATCH v3 1/6] mm: add AS_WRITEBACK_MAY_BLOCK mapping flag Joanne Koong
2024-11-07 19:16 ` [PATCH v3 2/6] mm: skip reclaiming folios in legacy memcg writeback contexts that may block Joanne Koong
2024-11-07 19:16 ` [PATCH v3 3/6] fs/writeback: in wait_sb_inodes(), skip wait for AS_WRITEBACK_MAY_BLOCK mappings Joanne Koong
2024-11-07 19:16 ` [PATCH v3 4/6] mm/memory-hotplug: add finite retries in offline_pages() if migration fails Joanne Koong
2024-11-07 19:16 ` [PATCH v3 5/6] mm/migrate: fail MIGRATE_SYNC for folios under writeback with AS_WRITEBACK_MAY_BLOCK mappings Joanne Koong
2024-11-07 19:22 ` Joanne Koong [this message]
2024-11-07 19:16 ` [PATCH v3 5/6] mm/migrate: skip migrating " Joanne Koong
2024-11-07 19:16 ` [PATCH v3 6/6] fuse: remove tmp folio for writebacks and internal rb tree Joanne Koong
2024-11-07 23:35 ` Joanne Koong
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='CAJnrk1YGqrssNGa6hzyd==LmfdJ2-TN86ofrHWi+9HLfDidDfw@mail.gmail.com' \
--to=joannelkoong@gmail.com \
--cc=bernd.schubert@fastmail.fm \
--cc=jefflexu@linux.alibaba.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=shakeel.butt@linux.dev \
/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