Thread (101 messages) 101 messages, 16 authors, 2022-12-02

Re: [PATCH v9 1/8] mm: Introduce memfd_restricted system call to create restricted user memory

From: Kirill A . Shutemov <hidden>
Date: 2022-12-02 13:44:42
Also in: kvm, linux-api, linux-arch, linux-fsdevel, linux-mm, lkml, qemu-devel

On Fri, Dec 02, 2022 at 02:49:09PM +0800, Chao Peng wrote:
On Thu, Dec 01, 2022 at 06:16:46PM -0800, Vishal Annapurve wrote:
quoted
On Tue, Oct 25, 2022 at 8:18 AM Chao Peng [off-list ref] wrote:
quoted
...
quoted
quoted
+}
+
+SYSCALL_DEFINE1(memfd_restricted, unsigned int, flags)
+{
Looking at the underlying shmem implementation, there seems to be no
way to enable transparent huge pages specifically for restricted memfd
files.

Michael discussed earlier about tweaking
/sys/kernel/mm/transparent_hugepage/shmem_enabled setting to allow
hugepages to be used while backing restricted memfd. Such a change
will affect the rest of the shmem usecases as well. Even setting the
shmem_enabled policy to "advise" wouldn't help unless file based
advise for hugepage allocation is implemented.
Had a look at fadvise() and looks it does not support HUGEPAGE for any
filesystem yet.
Yes, I think fadvise() is the right direction here. The problem is similar
to NUMA policy where existing APIs are focused around virtual memory
addresses. We need to extend ABI to take fd+offset as input instead.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help