Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263580AbTKQPsN (ORCPT ); Mon, 17 Nov 2003 10:48:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263565AbTKQPsN (ORCPT ); Mon, 17 Nov 2003 10:48:13 -0500 Received: from [68.14.236.254] ([68.14.236.254]:36574 "EHLO office.labsysgrp.com") by vger.kernel.org with ESMTP id S263580AbTKQPsG (ORCPT ); Mon, 17 Nov 2003 10:48:06 -0500 Message-ID: <3FB8ED91.3050305@backtobasicsmgmt.com> Date: Mon, 17 Nov 2003 08:47:29 -0700 From: "Kevin P. Fleming" Organization: Back to Basics Network Management User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030925 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Friesen CC: Andrey Borzenkov , Jeff Garzik , linux-kernel Subject: Re: Is initramfs freed after kernel is booted? References: <3FB8EBC2.1080800@nortelnetworks.com> In-Reply-To: <3FB8EBC2.1080800@nortelnetworks.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1029 Lines: 22 Chris Friesen wrote: > Absolutely, the memory should be reclaimed. I would have thought that > you could just unmount it--if the pivot_root is done properly there > shouldn't be any references left to the initramfs. There is no pivot_root happening here; the kernel creates a ramfs and mounts it on / (as rootfs), then unpacks the initramfs cpio archive into it. After doing a few more steps, it overmounts the real root onto /, making the rootfs filesystem invisible. It is not freed in the current kernels. I suspect that if you wanted to modify init/do_mounts.c, you could use the initrd technique of doing the pivot_root yourself (instead of letting the kernel automount the "real" root filesystem), at which point it maybe be possible to umount and free the rootfs. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/