linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	hughd@google.com, akpm@linux-foundation.org, willy@infradead.org,
	linux-mm@kvack.org, p.raghav@samsung.com, dave@stgolabs.net,
	a.manzanares@samsung.com, yosryahmed@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC v2 5/5] shmem: add support to ignore swap
Date: Thu, 23 Feb 2023 17:09:14 +0100	[thread overview]
Message-ID: <20230223160914.cwvt53drn2bckpdc@wittgenstein> (raw)
In-Reply-To: <Y/eDOXC4+vpCCBic@infradead.org>

On Thu, Feb 23, 2023 at 07:16:09AM -0800, Christoph Hellwig wrote:
> On Thu, Feb 23, 2023 at 01:26:31PM +0100, Christian Brauner wrote:
> > We would have use-cases for this in systemd. We currently use ramfs for
> > systemd's credential logic since ramfs is unswappable. It'd be very neat
> > if we could use tmpfs instead,
> 
> What is the advantage of using a swapless tmpfs over ramf?

There are a few reasons we usually prefer tmpfs over ramfs. Iirc, ramfs
doesn't have limits and grows dynamically. So we currently only use it
from the most privileged process where we do our own accounting and
immediately remount the superblock read-only. Tmpfs on the other hand
offers various ways to restrict memory consumption.

Other reasons are that ramfs doesn't support selinux labels, xattrs, and
acls in general which come in quite handy. Starting with kernel v6.3
tmpfs does also support idmapped mounts. So we usually always prefer
ramfs over tmpfs unless we have a very specific need such as the memory
not being swapped out.


  reply	other threads:[~2023-02-23 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  2:44 [RFC v2 0/5] tmpfs: add the option to disable swap Luis Chamberlain
2023-02-23  2:44 ` [RFC v2 1/5] shmem: remove check for folio lock on writepage() Luis Chamberlain
2023-02-23  2:44 ` [RFC v2 2/5] shmem: set shmem_writepage() variables early Luis Chamberlain
2023-02-23  2:44 ` [RFC v2 3/5] shmem: move reclaim check early on writepages() Luis Chamberlain
2023-02-23  2:44 ` [RFC v2 4/5] shmem: skip page split if we're not reclaiming Luis Chamberlain
2023-02-23  2:44 ` [RFC v2 5/5] shmem: add support to ignore swap Luis Chamberlain
2023-02-23 12:26   ` Christian Brauner
2023-02-23 15:16     ` Christoph Hellwig
2023-02-23 16:09       ` Christian Brauner [this message]
2023-02-23 19:43         ` Luis Chamberlain

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=20230223160914.cwvt53drn2bckpdc@wittgenstein \
    --to=brauner@kernel.org \
    --cc=a.manzanares@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=hch@infradead.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=willy@infradead.org \
    --cc=yosryahmed@google.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).