linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: -Gary- <me@garybgenett.net>
To: Qian Cai <cai@lca.pw>
Cc: Hugh Dickins <hughd@google.com>, linux-mm@kvack.org
Subject: Re: [PATCH] shmem: add shmem_size option, set filesystem size
Date: Mon, 7 Oct 2019 18:15:33 -0700	[thread overview]
Message-ID: <20191008011532.GB22291@spider> (raw)
In-Reply-To: <ECC7DF0A-9199-4A33-810C-1AD165B09D71@lca.pw>

> > A specific case where this is necessary would be if the initramfs were
> > larger than half of the memory, such as a 2.5GB filesystem with 4GB of
> > memory.  Without this option, this causes a kernel panic.  With this
> > option, the user may specify something like 75%, which would allow the
> > filesystem into memory, while still leaving enough resources to run
> > a functioning system.
> 
> Why would anyone need such a large an initramfs?

Thank you for such a quick response, Qian!  I really appreciate your question and consideration of my submission.

The use case here is a live distribution, where the initramfs is a standard filesystem.  It is common for these types of distributions to unpack root into memory.  Most of them use SquashFS, and resize shmem using a smaller initramfs first.

https://grml.org

In my case, I am unpacking straight from the initramfs to alleviate the need for a separate file and packaging everything in an ISO.  It very well could be that I am the only person who has ever needed this, but it has been a requirement for my distribution.

https://sourceforge.net/projects/gary-os
https://github.com/garybgenett/gary-os

It is also possible that other live distributions are taking the approach they are because of the current inability to load an initrd/initramfs directly into memory without manually resizing the shmem filesystem first.

Since I was in there hacking the feature, anyway, I thought it would be worth submitting.

At the least, it should be a "#define", or something.  Right now it is a hard-coded magic token.

Thoughts?

-- Gary


  reply	other threads:[~2019-10-08  1:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 22:32 Gary B. Genett
2019-10-07 22:50 ` Qian Cai
2019-10-08  1:15   ` -Gary- [this message]
2019-10-08  3:13     ` Qian Cai
2019-10-08 20:14       ` -Gary-

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=20191008011532.GB22291@spider \
    --to=me@garybgenett.net \
    --cc=cai@lca.pw \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    /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