[<prev] [next>] [day] [month] [year] [list]
Message-ID: <8ddeff27-267b-bc87-1061-9e7946fe9b42@huawei.com>
Date: Sat, 27 Nov 2021 17:19:41 +0800
From: Peng Liang <liangpeng10@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <linux-mm@...ck.org>, <hughd@...gle.com>,
<akpm@...ux-foundation.org>,
xiexiangyou 00584000 <xiexiangyou@...wei.com>,
zhengchuan <zhengchuan@...wei.com>, <wanghao232@...wei.com>,
chenwandun 00417970 <chenwandun@...wei.com>
Subject: Questions about page fault of memfd/shmem
Hi all,
I'm a user-space developer and I want to use memfd to share some memory
between parent and child processes.
For the demo, it works well. However, I fount that the RSS of the
process using memfd will grow up faster than that using anonymous
mappings. Dig some memfd/shmem code and I find that memfd/shmem will
allocate a page for a read page fault.
For my use case, the process may allocate tens or even hundreds of GiB
memory using memfd. So allocating all memory just because of reading it
will has a great impact.
Could memfd/shmem map to the global zero page instead of allocating a
page for a read page fault?
Thanks,
Peng
Powered by blists - more mailing lists