Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1751ybx; Wed, 30 Oct 2019 10:27:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNcJLIRuPMMnZRmpgJdIUVxvOvtYf5WpCNyiw0AiFaNrirV7DZQtfG5VS9wLgRCz1BF75e X-Received: by 2002:a50:cd53:: with SMTP id d19mr859906edj.197.1572456421251; Wed, 30 Oct 2019 10:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572456421; cv=none; d=google.com; s=arc-20160816; b=BXb9Z27UaDUR2AP8/VWTsJxTGH9pjFv+CgkvSvK33w8nIZyXS8EPa4rJrEMg1jBM6c RPVYPXM4PLIoGs+vYwKsbf/awMhw0mB2kR4l3jvbBbBddxjlcY49P2l7UB60s2EwVkTs LDSjF/laefACvXlx1Z1+5QX0lsR+pe5v/Ju+KXdZIzPuGrt11+Z8vQLheo0tW/k9/oqI ERTqmVGVb7A6Rl5LO5UMOirxvIsXcNZfpBZ5yapRIYlD+KoC64I3rQx4y7uWtGhVAw+T qqlYr25pqEsQ4LiYAA39VcF988WhffKChdN9GlVjdgas1rd6m0Eo29OCWrTcPWkJXjh8 Xgbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=Kb4n1V0seA/ZgYHtBmZ8iV+zYnoNVd+L2wWX8RTfW1M=; b=vKbj4H8QhL3mJ5m/W2crTabWoTlP2a39zka8LOlk2GB/cq/prSQr7rZJuk+dY4nppy /dCq7lvQwUwXiVTMgwG7r8S8br/u37ijqE7Y2Ng0+pRpnzZRQAs3X1YVoPWZLB/v5KJZ 9cgz1BU6Ug+0c8erpCi3gQ1kTpx9rY2DfpPFuJa665eUlnXDIHFVR6SwTBtT6QEgCmnW j6k3X9Tea0RO0LHFPy+TjSLc01RIshBG/YFvRemNCWQff5+6ItXGzKi9mRzE8wrFs0MW Xqvk/Jlp/kR/IJtNHHV1qsh9lBMEE4YoznWcBEhjmihogTJQUxpwwc9UunYxAZXAJs9c 6P3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=Un1nk9Ek; 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=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si1563306ejr.121.2019.10.30.10.26.37; Wed, 30 Oct 2019 10:27:01 -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=@aol.com header.s=a2048 header.b=Un1nk9Ek; 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=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfJ3RWx (ORCPT + 99 others); Wed, 30 Oct 2019 13:22:53 -0400 Received: from sonic304-24.consmr.mail.gq1.yahoo.com ([98.137.68.205]:36441 "EHLO sonic304-24.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfJ3RWx (ORCPT ); Wed, 30 Oct 2019 13:22:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1572456172; bh=Kb4n1V0seA/ZgYHtBmZ8iV+zYnoNVd+L2wWX8RTfW1M=; h=Date:From:To:Subject:References:In-Reply-To:From:Subject; b=Un1nk9EkHYaK0BMxOM2tsndHhH/1x7yC0PS/+NhGQ3LFO5n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NXsg83D3EJrZ3M19q.eq8BkSmGcRtku8h2r7GcBcmeWX85HSlJ0w_HcpmIDz0g1S5S 9XsWQovO7r5EhpY67TBnbbmoYCVk36asjR_gDyogp.06Y63jhD_UHnNWSbN3Larh_CUXMz7TPpTs GrNJiTCrRDPxiNUq9ia6FsWNZ4Eo6hD90fiSr00uB9fTky5RPGXJ4ilnRcSdhiX6j6BmfoT_Tvfv VsnpNrWA95JmH4ktnyE46.jJWl28x46suX2eW8JJOrsyZgt5vPN6Cq6gCXnPLkBUTOtAQISOTfGJ y__BWhFArZgROHVUwyAJjmZFBigK0GInRhtSmqz8w66rYwZzOaeGUOTe13S4GSdpxMhwiH2SvsCi PKFwpYaxGbehsb9AbS_ccC3QVhiZyNgjeqONh5t1SMncpNhck0JSjkyJ0pc7J1pMKvmSZ5U.QkKz 0zyJ3pqnKCi62C2J0q6jFKjzC.FYsO5mZDDqcU2axUh8GhsVSu.zBW1NB3SUz8j5_JjqsftSewFS V5rwJnDq7JAvY6.35Br0J8USDelvfFLxVxTuIfC.KtdTx_DqBSoPnqvPNTjCwZxxOJx2HipgGEVA vqKtD36H20RIuHquq6D_5FKxsfd07ESIuINmMsMGVPQc45BAgeIhYVMq4E72.vbcHEW8ra5PpVOA fKEmF7TLQVw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Wed, 30 Oct 2019 17:22:52 +0000 Received: by smtp415.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID c6b74f9a96653bcbb72edbf42affa5a8; Wed, 30 Oct 2019 17:22:50 +0000 (UTC) Date: Thu, 31 Oct 2019 01:22:44 +0800 From: Gao Xiang To: Chao Yu , Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Andrew Morton , Matthew Wilcox , Fengguang Wu Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: support data compression Message-ID: <20191030172234.GA7018@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20191022171602.93637-1-jaegeuk@kernel.org> <20191022171602.93637-2-jaegeuk@kernel.org> <20191027225006.GA321938@sol.localdomain> <20191030025512.GA4791@sol.localdomain> <97c33fa1-15af-b319-29a1-22f254a26c0a@huawei.com> <20191030165056.GA693@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030165056.GA693@sol.localdomain> User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailer: WebService/1.1.14593 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) Content-Length: 1904 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, (add some mm folks...) On Wed, Oct 30, 2019 at 09:50:56AM -0700, Eric Biggers wrote: > > >>> > > >>> It isn't really appropriate to create fake pagecache pages like this. Did you > > >>> consider changing f2fs to use fscrypt_decrypt_block_inplace() instead? > > >> > > >> We need to store i_crypto_info and iv index somewhere, in order to pass them to > > >> fscrypt_decrypt_block_inplace(), where did you suggest to store them? > > >> > > > > > > The same place where the pages are stored. > > > > Still we need allocate space for those fields, any strong reason to do so? > > > > page->mapping set implies that the page is a pagecache page. Faking it could > cause problems with code elsewhere. Not very related with this patch. Faking page->mapping was used in zsmalloc before nonLRU migration (see material [1]) and use in erofs now (page->mapping to indicate nonLRU short lifetime temporary page type, page->private is used for per-page information), as far as I know, NonLRU page without PAGE_MAPPING_MOVABLE set is safe for most mm code. On the other hands, I think NULL page->mapping will waste such field in precious page structure... And we can not get such page type directly only by a NULL -- a truncated file page or just allocated page or some type internal temporary pages... So I have some proposal is to use page->mapping to indicate specific page type for such nonLRU pages (by some common convention, e.g. some real structure, rather than just zero out to waste 8 bytes, it's also natural to indicate some page type by its `mapping' naming )... Since my English is not very well, I delay it util now... [1] https://elixir.bootlin.com/linux/v3.18.140/source/mm/zsmalloc.c#L379 https://lore.kernel.org/linux-mm/1459321935-3655-7-git-send-email-minchan@kernel.org and some not very related topic: https://lwn.net/Articles/752564/ Thanks, Gao Xiang