Reclaim space from unused ramdisk?

From: Mike Mohr
Date: Tue Jul 26 2005 - 17:20:27 EST

I wonder if it would be possible to somehow reclaim space that has
been previously reserved for a ramdisk without rebooting. I read the
ramdisk docs in the latest kernel source and it seems that it is not
currently possible. However, the kernel keeps track of the memory
allocated for said ramdisks; would it not be possible with root (or
even kernel) permissions to remove the flag that prevents the VM
subsystem from reclaiming that space? I realize that rot permissions
may not be high enough. In that case, could a module be written that
takes a device name as a parameter then uses it to look up the
reserved memory that device uses, then resets the necessary flag and
finally unloads itself? It would have to check that the filesystem
was unmounted, of course.

How difficult would this be to write?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at