[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190710213238.91835-1-henryburns@google.com>
Date: Wed, 10 Jul 2019 14:32:38 -0700
From: Henry Burns <henryburns@...gle.com>
To: Vitaly Wool <vitalywool@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Vitaly Vul <vitaly.vul@...y.com>,
Shakeel Butt <shakeelb@...gle.com>,
Jonathan Adams <jwadams@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Snild Dolkow <snild@...y.com>,
Thomas Gleixner <tglx@...utronix.de>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Henry Burns <henryburns@...gle.com>
Subject: [PATCH] mm/z3fold.c: remove z3fold_migration trylock
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@...gle.com>
---
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
Powered by blists - more mailing lists