Skip to content

Commit

Permalink
mm/z3fold.c: remove z3fold_migration trylock
Browse files Browse the repository at this point in the history
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)

Link: http://lkml.kernel.org/r/[email protected]
Fixes: 1f86298 ("mm/z3fold.c: support page migration")
Signed-off-by: Henry Burns <[email protected]>
Reviewed-by: Shakeel Butt <[email protected]>
Cc: Vitaly Wool <[email protected]>
Cc: Vitaly Vul <[email protected]>
Cc: Jonathan Adams <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Snild Dolkow <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
HenryBurns authored and torvalds committed Jul 17, 2019
1 parent 1732d2b commit be03074
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,16 +1350,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);
Expand Down Expand Up @@ -1391,7 +1386,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;
}
Expand Down

0 comments on commit be03074

Please sign in to comment.