Skip to contentSkip to conversation

Ramdisk Bug Report

DISCUSSION Zeng Yu 1 participant 1 message Jun 29, 2001

lore
Share & tools
lore

Zeng Yu

author
#0 lore raw

Hi all,

Since the first question about ramdisk, I've done more test against the problem both on kernel 2.2.16 and 2.4.4/2.4.5. Here's my test result:
kernel 2.4.4/2.4.5 have two ramdisk bugs.
1. the ramdisk uses two same size mem of buffers and cache, and the cache can NOT be used by other processes untill the ramdisk be unmounted.
2. the ramdisk can dynamically grow as more space is required, but it can NOT dynamically shrink as the space is released.
both bugs don't exist on kernel 2.2.16.

The test method is as follows:(on a 256M pentium 4 box, with default mamimum ramdisk_size 100M)
for bug 1:
mke2fs -m0 /dev/ram1; mke2fs -m0 /dev/ram2
mount /dev/ram1 /mnt1; mount /dev/ram2 /mnt2
dd if=/dev/zero of=/mnt1/data bs=1k count=96000
#now ram1 is 100M, should have space for another 100M ramdisk, BUT dd if=/dev/zero of=/mnt2/data bs=1k count=96000
system hang!

for bug 2:
mke2fs -m0 /dev/ram1; mke2fs -m0 /dev/ram2
mount /dev/ram1 /mnt1; mount /dev/ram2 /mnt2
dd if=/dev/zero of=/mnt1/data bs=1k count=96000
#same as above, but try to free allocated ramdisk buffers first rm /mnt1/data
#ram1 should shrink to about zero thus leave space for another 100M #ramdisk, BUT
dd if=/dev/zero of=/mnt2/data bs=1k count=96000
system still hang!