Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Aug 2005 13:14:35 -0700
From:      Glenn Dawson <glenn@antimatter.net>
To:        Munjal Kapadia <munjal_kapadia@yahoo.com>, freebsd-questions@freebsd.org
Subject:   Re: creation and deletion of ramdisk does not free up kernel address space
Message-ID:  <6.1.0.6.2.20050808125715.122cc7d0@cobalt.antimatter.net>
In-Reply-To: <20050808162727.83178.qmail@web54708.mail.yahoo.com>
References:  <20050808162727.83178.qmail@web54708.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 09:27 AM 8/8/2005, Munjal Kapadia wrote:
>Hi all,
>
>I do the following:
>
>1. I create a ramdisk the following way:
>mdconfig -a -t malloc -o reserve -s 128M
>
>2. then I delete the ramdisk:
>mdconfig -d -u md3
>
>3. next, I load a kmod. But I notice that the address
>the kmod gets loaded is off by 0x8000000 (= 128M) as
>compared to the address that the kmod gets loaded when
>i do not create and delete the ramdisk.
>
>Thus, without the creation and deletion of ramdisk, if
>kmod loads at 0x822e7000, then with the creation and
>deletion of ramdisk, the kmod loads at 0x8a2e7000
>
>
>Can someone please tell me why?

(Someone jump in here and correct me if I'm wrong)

When you un-configure the RAM disk, the memory it was using get's put on 
the inactive pages list.  From there, when a page is clean it can be moved 
to the cache list, and from there it can be moved to the free list and 
reallocated to another process.  So, allocating some memory and then 
freeing it doesn't make it available to reallocated right away.

-Glenn


>Thanks
>Munjal
>
>
>
>
>____________________________________________________
>Start your day with Yahoo! - make it your home page
>http://www.yahoo.com/r/hs
>
>_______________________________________________
>freebsd-questions@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.1.0.6.2.20050808125715.122cc7d0>