Mailinglist Archive: opensuse-factory (435 mails)

< Previous Next >
Re: [opensuse-factory] Proposal: /tmp as tmpfs
On 17/07/2020 13.50, Johannes Meixner wrote:


On 2020-07-17 13:12, Carlos E. R. wrote:
Methinks it would be nice to have a daemon that would assign
a dedicated memory cache to a directory, fixed size. Kind of mmap.
A mount option, perhaps. The files would be accessed in ram if small,
but remain on disk.

I think such kind of "daemon" already exists
and is already active all the time:
It is the kernel's buffer cache.

Not exactly. The kernel's buffer cache does it, but system wide, dynamically assigning the buffers to the recent activity. If you copy dvd image to another place, for instance, the buffers effectively disappear.

For example, on some machines, copying the install image to
an slow usb stick makes the entire machine slow, because the
file copy fills 4 gigs of ram, destroying the existing
buffers and making the entire filesystem slow as molasses.

My idea is different, buffers dedicated to a sole directory, or perhaps to a mount, that can not be repurposed by the kernel to serve some other disk activity. Thus the /tmp directory would act as if it was hosted on ram entirely, except when/if big files were written.

Call it an hybrid tmpfs perhaps, with persistence. With a configurable limit on ram used.

Cheers / Saludos,

Carlos E. R.
(from 15.1 x86_64 at Telcontar)

< Previous Next >
This Thread
Follow Ups