Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3600122ybk; Tue, 19 May 2020 08:30:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp1ilDwnBT/3Bw4ob3NTIjrsd5+lFLau14VHuYWmGfDEDK3A7oH4gcdnT3sTW+6fGDH66h X-Received: by 2002:a17:906:dbef:: with SMTP id yd15mr19880465ejb.5.1589902228694; Tue, 19 May 2020 08:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589902228; cv=none; d=google.com; s=arc-20160816; b=c6v1Z1cpewfw6/zW+EYCTM9zXJcVnf/zkJjMkCSIOiq09e2iH1r1ypAiypCid2I+oi XRIoPmNyzRAZMjyER5a0OrZW/p61e5QTyiGQyg9sGhmAJNGW6nWRvkcORmDUKTDsAonu BNzt/rBLXcpsezftP6i5Ew7GMgfdqzkXDkg3TEGmzcBiv4v2dxsjjn/gb45CxB1+7OSX PMZQlX5ZZbI6INdqyaeUpvWYMW0uaH0AEV42eNddkMbGfMXXIFrLv4qsz15ks0qbwwgY YQ6Z9fo2yQIj8ecTIURluYZF+zLy5k1ZZ/uIT2gHPyU3r+hpajvuMjFAXhCalMTeck+B /r4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=0y0AXsrF5dx/LTW+zN7LhvGgPxUO6L/vLfpMTQsuv8s=; b=zzUUQxiVoT7q8Th39cZ7VX8WLAyHtrhFD62WqJzh6KTBwgn4DjPDpbSntIxQDOmbZE 9sID5d8I6e2AjpKr+e1lXebt1hqVjUeuGLsZTGZUJcPT6VUBBk1rSGYn509ADbhvWQ6C iox2Z/mZh5p0186EU70+2sGr242IiRfa5DRhEp7D+3c3mvxSww4JwgGK1q7B/b0QuPBn mac5G7+JzZf5aDHcbDG76z5xMJ5+cHxqqzkXC+98vf3A5DqTkhI9rfWRsQUDhRwzbzLb ycwHyfKn/yTEEJgo9Pw2bnExylK9xg32d+ejrpvnvQR0ihLGNZucy4feMLkb2lXAiQFQ OMEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=NS5Al6HF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si78550ejh.334.2020.05.19.08.30.05; Tue, 19 May 2020 08:30:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=NS5Al6HF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729219AbgESP2b (ORCPT + 99 others); Tue, 19 May 2020 11:28:31 -0400 Received: from mout.gmx.net ([212.227.17.20]:57507 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgESP2a (ORCPT ); Tue, 19 May 2020 11:28:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1589902096; bh=CiwR7YvzvIouXQnYC3GA/5qmrQBH6HehUBkJ0yz4hD8=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=NS5Al6HFrtMsGkGhQWBAUuuSXCgxFl2irosTvyJLdjxyHRf5YhuTNEKIVbYz4yD+4 pFA+ZkJ1FeqRBzPQ4Wo0kAIiHbxMqRsRWgcOCEzJhuzKGT++P/o5t8ma5AhhnRA0of 1UTKLiNfW+v58I1caXKgvi5g7I0AyjC8uI7ByZws= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hsiangkao-HP-ZHAN-66-Pro-G1 ([120.242.72.127]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MlNp7-1jDW3X3fXZ-00lqV5; Tue, 19 May 2020 17:28:15 +0200 Date: Tue, 19 May 2020 23:27:49 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Guoqing Jiang , Andrew Morton , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@fromorbit.com, hch@infradead.org Subject: Re: [PATCH 10/10] mm/migrate.c: call detach_page_private to cleanup code Message-ID: <20200519152747.GA11416@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20200517214718.468-1-guoqing.jiang@cloud.ionos.com> <20200517214718.468-11-guoqing.jiang@cloud.ionos.com> <20200518221235.1fa32c38e5766113f78e3f0d@linux-foundation.org> <20200519100612.GA3687@hsiangkao-HP-ZHAN-66-Pro-G1> <20200519151632.GX16070@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519151632.GX16070@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:0Nr+HQn3nAxRsOJtI4q5EwM86pQQgQZG7KEm9Tq2RencbftXqf+ C6bC3GYN3AiraPEzGjdJ0pYEjP3UWyuRgHlAC2jU33dpEp/veJnf+e/AXuwA8tV3kNJUViw TY4kuIyCOGF+YggGZSBiV0Bjr8mzTPf6fuU8MTvP+sMoBszhGcJblv3cN1Iz+tF7Pcrmx0Z oHvd8MimZ124aTrWikk/w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qDJwCMbauy4=:HXts9pvt4bos19ExLobmwi /nonUctgUL/hcYIy8ldyGmnoK0kR4FIE4LMLfMGgBYTYQp1951G4beFUbzUC0UA9ua5hNLx7Y a2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W33qcIUSUAvUxa77UrNLi5NPftUb CQvPbqEO4z8p+XDXR6nUevRk4zjHgUKFLvyVG5VCAX1Vyzlo7q3yKhHEJUDWWUShbZlYHtlbl cSnCzEVeZSRLGnG5d Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthew, On Tue, May 19, 2020 at 08:16:32AM -0700, Matthew Wilcox wrote: > On Tue, May 19, 2020 at 06:06:19PM +0800, Gao Xiang wrote: > > In addition, I found some limitation of new {attach,detach}_page_priva= te > > helper (that is why I was interested in this series at that time [1] [= 2], > > but I gave up finally) since many patterns (not all) in EROFS are > > > > io_submit (origin, page locked): > > attach_page_private(page); > > ... > > put_page(page); > > > > end_io (page locked): > > SetPageUptodate(page); > > unlock_page(page); > > > > since the page is always locked, so io_submit could be simplified as > > set_page_private(page, ...); > > SetPagePrivate(page); > > , which can save both one temporary get_page(page) and one > > put_page(page) since it could be regarded as safe with page locked. > > It's fine to use page private like this without incrementing the refcoun= t, > and I can't find any problematic cases in EROFS like those fixed by comm= it > 8e47a457321ca1a74ad194ab5dcbca764bc70731 > > So I think the new helpers are not for you, and that's fine. They'll be > useful for other filesystems which are using page_private differently > from the way that you do. Yes, I agree. Although there are some dead code in EROFS to handle some truncated case, which I'd like to use in the future. Maybe I can get rid of it temporarily... But let me get LZMA fixed-sized output compression for EROFS in shape at first, which seems useful as a complement of LZ4... Thanks, Gao Xiang