Re: [PATCH v3 5/6] mm/migrate: fail MIGRATE_SYNC for folios under writeback with AS_WRITEBACK_MAY_BLOCK mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 7, 2024 at 11:17 AM Joanne Koong <joannelkoong@xxxxxxxxx> 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@xxxxxxxxx/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@xxxxxxxxx>
> ---
>  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
>





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux