linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Henry Burns <henryburns@google.com>
Cc: Vitaly Wool <vitalywool@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Vitaly Vul <vitaly.vul@sony.com>,
	Jonathan Adams <jwadams@google.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Snild Dolkow <snild@sony.com>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Linux MM <linux-mm@kvack.org>,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/z3fold.c: remove z3fold_migration trylock
Date: Wed, 10 Jul 2019 14:39:55 -0700	[thread overview]
Message-ID: <CALvZod7kMX5Xika8nqywyXHuBKqTfSPP7uZ1-OU2M4kmHLiuUw@mail.gmail.com> (raw)
In-Reply-To: <20190710213238.91835-1-henryburns@google.com>

On Wed, Jul 10, 2019 at 2:32 PM Henry Burns <henryburns@google.com> wrote:
>
> z3fold_page_migrate() will never succeed because it attempts to acquire a
> lock that has already been taken by migrate.c in __unmap_and_move().
>
> __unmap_and_move() migrate.c
>   trylock_page(oldpage)
>   move_to_new_page(oldpage_newpage)
>     a_ops->migrate_page(oldpage, newpage)
>       z3fold_page_migrate(oldpage, newpage)
>         trylock_page(oldpage)
>
>
> Signed-off-by: Henry Burns <henryburns@google.com>

Reviewed-by: Shakeel Butt <shakeelb@google.com>

Please add the Fixes tag as well.

> ---
>  mm/z3fold.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index 985732c8b025..9fe9330ab8ae 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -1335,16 +1335,11 @@ static int z3fold_page_migrate(struct address_space *mapping, struct page *newpa
>         zhdr = page_address(page);
>         pool = zhdr_to_pool(zhdr);
>
> -       if (!trylock_page(page))
> -               return -EAGAIN;
> -
>         if (!z3fold_page_trylock(zhdr)) {
> -               unlock_page(page);
>                 return -EAGAIN;
>         }
>         if (zhdr->mapped_count != 0) {
>                 z3fold_page_unlock(zhdr);
> -               unlock_page(page);
>                 return -EBUSY;
>         }
>         new_zhdr = page_address(newpage);
> @@ -1376,7 +1371,6 @@ static int z3fold_page_migrate(struct address_space *mapping, struct page *newpa
>         queue_work_on(new_zhdr->cpu, pool->compact_wq, &new_zhdr->work);
>
>         page_mapcount_reset(page);
> -       unlock_page(page);
>         put_page(page);
>         return 0;
>  }
> --
> 2.22.0.410.gd8fdbe21b5-goog
>


  reply	other threads:[~2019-07-10 21:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 21:32 Henry Burns
2019-07-10 21:39 ` Shakeel Butt [this message]
2019-07-10 21:51   ` Henry Burns

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=CALvZod7kMX5Xika8nqywyXHuBKqTfSPP7uZ1-OU2M4kmHLiuUw@mail.gmail.com \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=henryburns@google.com \
    --cc=jwadams@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=snild@sony.com \
    --cc=tglx@linutronix.de \
    --cc=vitaly.vul@sony.com \
    --cc=vitalywool@gmail.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