From: Sean Christopherson <seanjc@google.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Ackerley Tng <ackerleytng@google.com>,
kvm@vger.kernel.org, linux-api@vger.kernel.org,
linux-arch@vger.kernel.org, linux-doc@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, qemu-devel@nongnu.org, aarcange@redhat.com,
ak@linux.intel.com, akpm@linux-foundation.org, arnd@arndb.de,
bfields@fieldses.org, bp@alien8.de, chao.p.peng@linux.intel.com,
corbet@lwn.net, dave.hansen@intel.com, david@redhat.com,
ddutile@redhat.com, dhildenb@redhat.com, hpa@zytor.com,
hughd@google.com, jlayton@kernel.org, jmattson@google.com,
joro@8bytes.org, jun.nakajima@intel.com,
kirill.shutemov@linux.intel.com, linmiaohe@huawei.com,
luto@kernel.org, mail@maciej.szmigiero.name,
michael.roth@amd.com, mingo@redhat.com, naoya.horiguchi@nec.com,
pbonzini@redhat.com, qperret@google.com, rppt@kernel.org,
shuah@kernel.org, steven.price@arm.com, tabba@google.com,
tglx@linutronix.de, vannapurve@google.com, vbabka@suse.cz,
vkuznets@redhat.com, wanpengli@tencent.com,
wei.w.wang@intel.com, x86@kernel.org,
yu.c.zhang@linux.intel.com, muchun.song@linux.dev,
feng.tang@intel.com, brgerst@gmail.com, rdunlap@infradead.org,
masahiroy@kernel.org, mailhol.vincent@wanadoo.fr
Subject: Re: [RFC PATCH 0/6] Setting memory policy for restrictedmem file
Date: Fri, 14 Apr 2023 17:24:20 +0000 [thread overview]
Message-ID: <ZDmMRAZYgLJ+x4l9@google.com> (raw)
In-Reply-To: <ZDjzpKL9Omcox991@dhcp22.suse.cz>
On Fri, Apr 14, 2023, Michal Hocko wrote:
> On Fri 14-04-23 00:11:49, Ackerley Tng wrote:
> > 3. A more generic fbind(): it seems like this new functionality is
> > really only needed for restrictedmem files, hence a separate,
> > specific syscall was proposed to avoid complexities with handling
> > conflicting policies that may be specified via other syscalls like
> > mbind()
>
> I do not think it is a good idea to make the syscall restrict mem
> specific.
+1. IMO, any uAPI that isn't directly related to the fundamental properties of
restricted memory, i.e. isn't truly unique to restrictedmem, should be added as
generic fd-based uAPI.
> History shows that users are much more creative when it comes
> to usecases than us. I do understand that the nature of restricted
> memory is that it is not mapable but memory policies without a mapping
> are a reasonable concept in genereal. After all this just tells where
> the memory should be allocated from. Do we need to implement that for
> any other fs? No, you can safely return EINVAL for anything but
> memfd_restricted fd for now but you shouldn't limit usecases upfront.
I would even go a step further and say that we should seriously reconsider the
design/implemenation of memfd_restricted() if a generic fbind() needs explicit
handling from the restricted memory code. One of the goals with memfd_restricted()
is to rely on the underlying backing store to handle all of the "normal" behaviors.
prev parent reply other threads:[~2023-04-14 17:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 0:11 [RFC PATCH 0/6] Setting memory policy for restrictedmem file Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 1/6] mm: shmem: Refactor out shmem_shared_policy() function Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 2/6] mm: mempolicy: Refactor out mpol_init_from_nodemask Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 3/6] mm: mempolicy: Refactor out __mpol_set_shared_policy() Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 4/6] mm: mempolicy: Add and expose mpol_create Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 5/6] mm: restrictedmem: Add memfd_restricted_bind() syscall Ackerley Tng
2023-04-14 0:11 ` [RFC PATCH 6/6] selftests: mm: Add selftest for memfd_restricted_bind() Ackerley Tng
2023-04-14 6:33 ` [RFC PATCH 0/6] Setting memory policy for restrictedmem file Michal Hocko
2023-04-14 17:24 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZDmMRAZYgLJ+x4l9@google.com \
--to=seanjc@google.com \
--cc=aarcange@redhat.com \
--cc=ackerleytng@google.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bfields@fieldses.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=chao.p.peng@linux.intel.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=ddutile@redhat.com \
--cc=dhildenb@redhat.com \
--cc=feng.tang@intel.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=jlayton@kernel.org \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=jun.nakajima@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mail@maciej.szmigiero.name \
--cc=mailhol.vincent@wanadoo.fr \
--cc=masahiroy@kernel.org \
--cc=mhocko@suse.com \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=muchun.song@linux.dev \
--cc=naoya.horiguchi@nec.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qperret@google.com \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=steven.price@arm.com \
--cc=tabba@google.com \
--cc=tglx@linutronix.de \
--cc=vannapurve@google.com \
--cc=vbabka@suse.cz \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=wei.w.wang@intel.com \
--cc=x86@kernel.org \
--cc=yu.c.zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).