creation and deletion of ramdisk does not free up kernel address space

Glenn Dawson glenn at
Mon Aug 8 20:14:28 GMT 2005

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.


>Start your day with Yahoo! - make it your home page
>freebsd-questions at mailing list
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list