public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Can't free the ramdisk (initrd, pivot_root)
@ 2001-04-15 20:57 Amit D Chaudhary
  2001-04-16  1:32 ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Amit D Chaudhary @ 2001-04-15 20:57 UTC (permalink / raw)
  To: linux-kernel

On the same topic, I have not found any change in free memory reported before 
and after the ioctl call. Though umount /initrd does free around 2 MB.


Amit


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Can't free the ramdisk (initrd, pivot_root)
@ 2001-06-18 13:21 Ralph Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Ralph Jones @ 2001-06-18 13:21 UTC (permalink / raw)
  To: linux-kernel

On Sun Apr 15 2001 - 15:57:52, EST Amit D Chaudhary (amit@muppetlabs.com) wrote:

>  On the same topic, I have not found any change in free memory reported before 
>  and after the ioctl call. Though umount /initrd does free around 2 MB. 

I have found the same thing - that umount /initrd seems to free the memory and that freeramdisk (with the patch to rd.c) does not appear to do anything.  

I have not found any more correspondance about this topic and was wondering if this behaviour was ok.  Specifically I would like to know if I need to apply the rd.c patch and then to run freeramdisk, or if I can just leave this out.  

Ralph Jones

Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Can't free the ramdisk (initrd, pivot_root)
@ 2001-04-15  6:36 H. Peter Anvin
  2001-04-15 18:26 ` Scott Murray
  0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2001-04-15  6:36 UTC (permalink / raw)
  To: linux-kernel

Hello friends,

I am trying the following setup, and it works beautifully, *except*
that I don't seem to be able to free the ramdisk memory at the end.
This is using the 2.4.3 stock kernel:

I load an initrd in "non-initrd" mode:

label single
        kernel vmlinuz
        append initrd=initrd.gz root=/dev/ram0 init=/linuxrc single

The initrd sets up a ramfs which is intended to become the root
filesystem, and then calls pivot_root:

[....]
umount /proc

# At this point, all that is mounted is /ram and /ram/usr

# Switch roots and run init
cd /ram
pivot_root /ram /ram/initrd
exec /sbin/init "$@"


(And yes, the /ram/initrd mount point directory does exist.)

This successfully runs init, and I can umount /initrd in the new
setup, but I cannot then destroy the ramdisk contents by calling
ioctl([/dev/ram0], BLKFLSBUF, 0) -- it always returns EBUSY.  What is
holding this ramdisk busy, especially since I could successfully
umount the filesystem?  Seems like a bug to me.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-06-18 13:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-15 20:57 Can't free the ramdisk (initrd, pivot_root) Amit D Chaudhary
2001-04-16  1:32 ` H. Peter Anvin
2001-04-16  1:53   ` Scott Murray
  -- strict thread matches above, loose matches on Subject: below --
2001-06-18 13:21 Ralph Jones
2001-04-15  6:36 H. Peter Anvin
2001-04-15 18:26 ` Scott Murray
2001-04-16  1:31   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox