Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9680428ybi; Wed, 10 Jul 2019 14:53:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+GpxQpWys3bAF6OKYb45a+rnTyTNCM7pvvVvyfcVN4nduO4VCQmC7+3NJeVGV4PfTz2Eu X-Received: by 2002:a65:648e:: with SMTP id e14mr471048pgv.317.1562795605289; Wed, 10 Jul 2019 14:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562795605; cv=none; d=google.com; s=arc-20160816; b=QP+8Sdee3wCvI4pRQfODdXJj/w9u3EBrUPwGdTJqZxZ8olocE2qQ15Cv7CSuUehZgG 1Ya9l2F3d4CaXGrtwj73QI2A13YbS0IiLlIaNLYZJmY78TC0QdF5eiiGuaJ+dr+JmlO+ gCmoIetl0/4BnX/bJtHtRE1VLvYCjRuynyQ10psLHCjbAXZbS3a5Z+r8JBPo8rydb+dv 8JB145FK/vlHJ21saoOkVERgJaZhCWhdSwRsiGKvHGfWFIDPvt3/vEJ0qAqTfUXWNhoa TouRpoWu+pM9AFvR2dPeoEu4S7R/b1BIJ/6o3EHrJayDCgLLAJ18eZANjjTUKLF3cBwQ RWrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4raB3IqyErqkg+JW+87rFy9oaXPi9i1d2UYtDB+hVu8=; b=lDXKY/+fskFvIxPwfSffvbdVcO5WN/rdOFLOItOWseWF1zGdzdGDFhHcwC6q3SmpcN Bl2nK7NIb5it9+jr/1Em8Lg4M56bdqau6r8m1J/fdam2eRwwa4q5rDjcJQnPcj2qZoEP lQGtqkzeXDJ14aXjW3xiVt6HE7DTxD/cRm7M23x4yJZR+to5k6H+SKY6867YhTKjv4u6 EVB661DbFpIITD6udGTII5gWncysYUQLUtKa0199BnLH8sYx04ZmkswN7X1bfXKCU1ky 3X4t450AssFwqGBM6sr8YWFyjBnHNhjJHNZKYRfHa/nZiNksVqULhrQIg1Pe06r4gtUi 11rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pMiktFKk; 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 b21si3142189pjo.49.2019.07.10.14.53.09; Wed, 10 Jul 2019 14:53:25 -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=pMiktFKk; 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 S1727681AbfGJVvx (ORCPT + 99 others); Wed, 10 Jul 2019 17:51:53 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:40888 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbfGJVvx (ORCPT ); Wed, 10 Jul 2019 17:51:53 -0400 Received: by mail-pf1-f193.google.com with SMTP id p184so1706872pfp.7 for ; Wed, 10 Jul 2019 14:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4raB3IqyErqkg+JW+87rFy9oaXPi9i1d2UYtDB+hVu8=; b=pMiktFKkY/frqdyoQe7sXxn6LL1Cu1eJU2aCdvxnAIjKEfBMVT2/a7GBTubBVbfWa+ VrkYciVMRwRGNBsyxWRacUlQbz9KrF+YgOEQ71hxJjkKxT2GbmMOnuU6hw3Edpz1rbCX TVaEQ4RgH61os6AyO9go6PMGvQHfA26T17tshvtfCu+Y4EWNOD1RFFj6LJF3db0kSaGw 8Y52qRyryah4clumr06EeeGgyEUDxNrK5Yj8CqCVoefgScQMSh511m0RPf+Ki7n+w5rf lcuyhHFh80YdhFGhsoBdDpij2xLcvg2j6MpWyUseC13csarlkuF/J5ijYVFflfpMRiG4 GUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4raB3IqyErqkg+JW+87rFy9oaXPi9i1d2UYtDB+hVu8=; b=Ni6Tc8tINniwWOc/oSkF43orDneHCXZi0yzwvsmR2Ftle+QyqUY19DQyfA6cPb9kts zC3RhXOSCV+RiNTzdjKwKMTKiWzlE6zLDHqElmaWiMuNhkmkWYgAMDK90kz212SgnzaP dtpmaghLFfNRJtgttoRLnLDsSRvVPw7g3VvhB0LQ/TRZhzVhvDKogv8HCKJyNaIOKrzB 2CqLFgTgSASU3b9OkUQYYf7D3wtJ2E9CZJF/VsHkmV5Vl1rpn0nuuNdTt/DEwBA72ZIy RILaKLvxTU72ZQgCX/3oL+qgxZSKKH7G8KDekTmZ4ZxnwZtRig4TzJ3Esd3wRyOtsg5Z 0D0w== X-Gm-Message-State: APjAAAURESH2dRC/xUQIYp2dFa/D3HeX5fz8lBJvz6nEVTgvk0zdHLLe XDAEI/0jNPV0HjN8RXcLQttMZBU/Z0iYo3nIJuUckA== X-Received: by 2002:a17:90a:380d:: with SMTP id w13mr620824pjb.138.1562795512264; Wed, 10 Jul 2019 14:51:52 -0700 (PDT) MIME-Version: 1.0 References: <20190710213238.91835-1-henryburns@google.com> In-Reply-To: From: Henry Burns Date: Wed, 10 Jul 2019 14:51:16 -0700 Message-ID: Subject: Re: [PATCH] mm/z3fold.c: remove z3fold_migration trylock To: Shakeel Butt Cc: Vitaly Wool , Andrew Morton , Vitaly Vul , Jonathan Adams , Greg Kroah-Hartman , Snild Dolkow , Thomas Gleixner , Linux MM , LKML 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 > > Reviewed-by: Shakeel Butt > > Please add the Fixes tag as well. Fixes: 1f862989b04a ("mm/z3fold.c: support page migration") > > > --- > > 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 > >