On 2022-04-08, Stuart Henderson <stu.li...@spacehopper.org> wrote: > On 2022-04-08, Stefan Hagen <sh+openbsd-m...@codevoid.de> wrote: >> Mihai Popescu wrote (2022-04-08 05:17 CEST): >>> Since my computer is struggling with chromium and I suspect it's the >>> disk access being too slow, I want to map the directory accessed by >>> chromium ( i think it is ~/.cache) into the memory. >>> >>> Looking in the man, i spotted rd, but i think i need to setup this in >>> the kernel. >>> The next choice is tmpfs. >>> The next one is mfs. >>> >>> I have no experience with this stuff, so does it worth to take this >>> approach? >>> If so, what is the recommended fs, please? >>> Is it possible to map/mount a directory from a partition only, or is >>> it the entire partition only accepted as a mount argument? > > Just as with a disk/network filesystem, you can mount it at whatever > directory you like. So directly over /home/username/.cache is possible. > >> I haven't played with rd or tmpfs, but this works: > > rd is for creating the "ramdisk" kernel for the installer or similar > use-cases. > > tmpfs is disabled in GENERIC kernels, so you'll need to build your own, > and hope you don't run into the reason for it being disabled. > > mfs is probably right for this case (but do check speeds though; > for Mihai's use-case it seems likely to be better, but a decent SSD is > likely to be same/faster than mfs.
Since someone complained offlist that I didn't include figures: # cd /mnt/mfs; for i in `jot 5`; do dd if=/dev/zero of=foo bs=1m count=990 2>&1 | grep bytes; done 1038090240 bytes transferred in 2.641 secs (392976029 bytes/sec) 1038090240 bytes transferred in 2.627 secs (395040864 bytes/sec) 1038090240 bytes transferred in 2.660 secs (390203934 bytes/sec) 1038090240 bytes transferred in 2.693 secs (385398220 bytes/sec) 1038090240 bytes transferred in 2.688 secs (386081589 bytes/sec) # cd ~; for i in `jot 5`; do dd if=/dev/zero of=foo bs=1m count=990 2>&1 | grep bytes; done 1038090240 bytes transferred in 2.311 secs (449182544 bytes/sec) 1038090240 bytes transferred in 2.314 secs (448454320 bytes/sec) 1038090240 bytes transferred in 2.303 secs (450684315 bytes/sec) 1038090240 bytes transferred in 2.303 secs (450627092 bytes/sec) 1038090240 bytes transferred in 2.311 secs (449121684 bytes/sec) Obviously it is going to vary by hardware, I have seen a bigger difference before. In this case the drive is a SATA-connected Samsung 860 EVO 500GB (plain not softraid crypto) on an AMD EPYC running i386. -- Please keep replies on the mailing list.