Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9670183ybi; Wed, 10 Jul 2019 14:40:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTIwiUpqvpaSHszdM4pLGKlDFtXnE4msHbzmamO/y9OG6ibQpJ2cVUGr4Lsqu9YfdYRM0t X-Received: by 2002:a65:430b:: with SMTP id j11mr387531pgq.383.1562794805418; Wed, 10 Jul 2019 14:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562794805; cv=none; d=google.com; s=arc-20160816; b=feTZzfplr7Itiax7g5nyKGee21OPibmWJ3EZViA9F+JRPIaDk0xz6Hg54z7nUhPW2O poV5cTRmq6ozlx2OxAMdMbc63/QDU3xQkyD0PKeP0/VFflqNfts8+Km7ssQGv9775Hn9 W7y4hCh4Bs6nCJ9uJ/CkHmqICQ1Pz67+HdyVTj6LZFqQAY6RdLPKq5UMLjBuZmHTZgDe qh4bFu4Z9dJpwHLz/p2JKhDof8LpJa5AnGkg19u9qpC15NhO38FikPzzB4GdfCnVXv27 gTNdU1e2UpDYkoyN6r27Sy8QErAqIddM9QHbu9pjNSX+9Qxz0TetG52a5uZ5p0KXH49n /dgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=D4vxIycjAa/oRBETN9HeGCijuet8TadWyyhq7cpzL/s=; b=dn/vNkvNM4HLyketq+oFdpgvk21AhleUXErOjEF3jSikey1okTLKmQxATV2MR3r/wv mLVqFov+OLshi+kFhnp54/4U3VFMpX9KwPAk5UaNGIv4i35hptKYjzmZCaEd59+nnLDh ZY6jF+VLsu1LfjVcShYj+kRwFlZIbc+VmylHMv6smn5HO5l3/aoC4TstzU3feB2r8wjA Drd1XGPlMpakdJeZlXmohFfmDcIDcvOsCDBnmhvwmh0u3p9qF1Klz+Xl2vCXQ4uAFtS8 cD7HD/PIM49rU8KtOyUknlr5nNUn2TEAb8eYA2ovP06F0MFlLzVyrKj8tz34ZhE0CroU yi4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MlbQLz+2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e92si2893113pld.312.2019.07.10.14.39.49; Wed, 10 Jul 2019 14:40:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MlbQLz+2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727782AbfGJVct (ORCPT + 99 others); Wed, 10 Jul 2019 17:32:49 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:35355 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbfGJVct (ORCPT ); Wed, 10 Jul 2019 17:32:49 -0400 Received: by mail-pl1-f202.google.com with SMTP id s21so1969008plr.2 for ; Wed, 10 Jul 2019 14:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=D4vxIycjAa/oRBETN9HeGCijuet8TadWyyhq7cpzL/s=; b=MlbQLz+2fkGnqHycT99BCVEXFcIhY0NwQnphKHCTU8Gz9tipQo+9WHu51grPurjhXe a2mJ8ImxNmgAbiTIYRG/nSGwe2kz43z1U4ZFd89xe0Qe96E9FIxdd44b8vQ+Qtm9V9b5 HXkWdEoy/bQqkyx07h4E6LUexLwmJCyUDimPcIRIL4qOhQYwmfLIrt3mAISYUmIFbA4S uN7O6+RFujww9gENEH3kpQJwwTNEUg7kBMszggQSnFpNEPgoXxJgqD+B8MPrcpHgxie9 owYX9XCkjhjvjOD8la1tz+HhhRIty/YyOGFWGKeYu2TZ7aDtu9hj+njqVG0AF4Gd16+w Tt2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=D4vxIycjAa/oRBETN9HeGCijuet8TadWyyhq7cpzL/s=; b=IjmKPkinF4/v/nuKBa3cgfIxgQhERCdCwM3zKepyNMMMz7aeWW2+zeQHLbZGllPu6C Enl32bM3vzkH3Wx56+PIXb6tMQe+zGrfdcyL46axpxjBf1JH8dzWg5OQGKhWi6FL62LN wFo1W8DUg22xcALMj/nDHsejrsTSBVdL31udGdqUh9xTI0EUYcTMyugxOFZixI4zSyFU E265eTHsKRlpKPwlPfw42SRNv5CwLz/OV1HbsMAZTQon4a9Gsk+GdAMKe/TWNazFs6T3 J269E40V05RyAQoyK1UBvnLDy3LGcxH528atuUwcZ7hebHlpQnNNRHSGkD1k46dtyJAJ eJBw== X-Gm-Message-State: APjAAAVUR9iRE2h/opVmRU9lU1U4srkWAt117s99P37AcsSzcMF0Xa2K yi1NWCsjClAvjTGikoltMKKQvlyTWL1RkOcS X-Received: by 2002:a65:65c5:: with SMTP id y5mr407700pgv.342.1562794368035; Wed, 10 Jul 2019 14:32:48 -0700 (PDT) Date: Wed, 10 Jul 2019 14:32:38 -0700 Message-Id: <20190710213238.91835-1-henryburns@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH] mm/z3fold.c: remove z3fold_migration trylock From: Henry Burns To: Vitaly Wool , Andrew Morton Cc: Vitaly Vul , Shakeel Butt , Jonathan Adams , Greg Kroah-Hartman , Snild Dolkow , Thomas Gleixner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Henry Burns Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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