I would like some hints regarding the maximum size of mfs. mount_mfs(8) says:
Note however that for mount_mfs the practical limit is based on datasize in login.conf(5), and ultimately depends on the per- arch MAXDSIZ limit. So, I searched for the MAXDSIZ value in the source code. # cd /usr/src/sys/arch # grep -rs 'define[ ]*MAXDSIZ' amd64 arm64 i386 amd64/include/vmparam.h:#define MAXDSIZ ((paddr_t)32*1024*1024*1024) /* max data size */ arm64/include/vmparam.h:#define MAXDSIZ ((paddr_t)16*1024*1024*1024) /* max data size */ i386/include/vmparam.h:#define MAXDSIZ (3UL*1024*1024*1024) /* max data size */ I found that it is defined as 32GB for amd64, 16GB for arm64, and 3GB for i386. When I try mfs mount on each architecture, I generally get the capacity specified by the kernel on amd64 and arm64, but on i386, the limit is reached with a value much smaller than MAXDSIZ. As you can see, I set each resource value to the maximum with ulimit. The data size is set to 3 GB. # ulimit -a time(cpu-seconds) unlimited file(blocks) unlimited coredump(blocks) unlimited data(kbytes) 3145728 stack(kbytes) 8192 lockedmem(kbytes) unlimited memory(kbytes) 3838984 nofiles(descriptors) 128 processes 1310 However, when I run the mfs mount, the maximum value is a little larger than 1GB. # mount -t mfs -o -s=1351M swap /mnt # umount /mnt # mount -t mfs -o -s=1352M swap /mnt mount_mfs: mmap: Cannot allocate memory What could be the cause? Is there any way to increase the MAXDSIZ to nearly 3GB? ---- Yoshihiro Kawamata http://fuguita.org/