From: Mel Gorman <mgorman@techsingularity.net>
To: yong w <yongw.pur@gmail.com>
Cc: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, nico@fluxnic.net,
wang.yong12@zte.com.cn
Subject: Re: Re: [BUG] ramfs system panic when using dd to create files
Date: Thu, 15 Jul 2021 12:44:24 +0100 [thread overview]
Message-ID: <20210715114424.GR3809@techsingularity.net> (raw)
In-Reply-To: <CAOH5QeCV3c-=RiwGrUn7214NRZye7wYFmPSyFWxw-0Zvk=j2GQ@mail.gmail.com>
On Wed, Jul 14, 2021 at 10:30:22PM +0800, yong w wrote:
> Thanks for your reply!
>
> > Limit max size of ramfs.
> It's no use using size to limit the size of ramfs.
> "mount -t ramfs -o size=10M ramfs /ramfs" is the command i use.
>
ramfs does not support size= limiting, that's what tmpfs is for.
> >
> > The comments already explains why kernel should panic on this situation:
> > /*
> > * If we got here due to an actual allocation at the
> > * system level, we cannot survive this and will enter
> > * an endless loop in the allocator. Bail out now.
> > */
>
> But it causes panic, actually , I don't want it panics
Then use tmpfs and specify size=. It's mentioned in filesystems/tmpfs.rst
--8<--
If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them.
--8<--
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2021-07-15 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 9:58 [BUG] ramfs system panic when using dd to create files yong w
2021-07-14 0:24 ` yong w
2021-07-14 7:35 ` wuzhouhui
2021-07-14 14:30 ` yong w
2021-07-15 11:44 ` Mel Gorman [this message]
2021-07-14 14:36 ` Michal Hocko
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=20210715114424.GR3809@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nico@fluxnic.net \
--cc=wang.yong12@zte.com.cn \
--cc=wuzhouhui14@mails.ucas.ac.cn \
--cc=yongw.pur@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.