[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191030172234.GA7018@hsiangkao-HP-ZHAN-66-Pro-G1>
Date: Thu, 31 Oct 2019 01:22:44 +0800
From: Gao Xiang <hsiangkao@....com>
To: Chao Yu <yuchao0@...wei.com>, Jaegeuk Kim <jaegeuk@...nel.org>,
linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net,
Andrew Morton <akpm@...ux-foundation.org>,
Matthew Wilcox <willy@...radead.org>,
Fengguang Wu <fengguang.wu@...el.com>
Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: support data compression
Hi Eric,
(add some mm folks...)
On Wed, Oct 30, 2019 at 09:50:56AM -0700, Eric Biggers wrote:
<snip>
> > >>>
> > >>> 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
Powered by blists - more mailing lists