[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190918061237.682280260@linuxfoundation.org>
Date: Wed, 18 Sep 2019 08:19:30 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Henry Burns <henryburns@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
Vitaly Wool <vitalywool@...il.com>,
Vitaly Vul <vitaly.vul@...y.com>,
Jonathan Adams <jwadams@...gle.com>,
Snild Dolkow <snild@...y.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH 5.2 72/85] mm/z3fold.c: remove z3fold_migration trylock
From: Henry Burns <henryburns@...gle.com>
commit be03074c9af25d06cf8e9ebddfcd284c0bf7f947 upstream.
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/20190710213238.91835-1-henryburns@google.com
Fixes: 1f862989b04a ("mm/z3fold.c: support page migration")
Signed-off-by: Henry Burns <henryburns@...gle.com>
Reviewed-by: Shakeel Butt <shakeelb@...gle.com>
Cc: Vitaly Wool <vitalywool@...il.com>
Cc: Vitaly Vul <vitaly.vul@...y.com>
Cc: Jonathan Adams <jwadams@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Snild Dolkow <snild@...y.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
mm/z3fold.c | 6 ------
1 file changed, 6 deletions(-)
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1439,16 +1439,11 @@ static int z3fold_page_migrate(struct ad
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;
}
if (work_pending(&zhdr->work)) {
@@ -1494,7 +1489,6 @@ static int z3fold_page_migrate(struct ad
spin_unlock(&pool->lock);
page_mapcount_reset(page);
- unlock_page(page);
put_page(page);
return 0;
}
Powered by blists - more mailing lists