memory allocation / deallocation within the kernel

Bharma Ji bharmaji at gmail.com
Tue May 2 18:19:29 UTC 2006


I am trying to understand the impact of memory allocation / deallocation
within the kernel. As I understand
a) Kernel memory is not pageable ie the one you get from using kernel
malloc(there may be exceptions)
b) Does this imply that if I have 1 GB of RAM - then I cannot reserve more
than 1 GB of kernel virtual address space? The reason is that if at any
point of time, the kernel has to allocate all of its virtual address space
i.e. if it needs to allocate more than 1 GB of address space, there won't be
any physical RAM memory to allocate from and thus this scenario is not
allowed as a configuration?
c) Another scenario is that assume that the kernel has 512 MB of virtual
address space with 1 GB of RAM. Now assume that the entire 1 GB of RAM is
used up by the kernel and other userland process that are running - with the
kernel taking 256 MB and the rest allocated to the processes. Now if the
kernel needs to allocate more memory, will some of the processes be swapped
out to make way for the kernel(since the kernel can take upto 512 MB)

Thanks for any answers. Any URL / literature that explains this will also be
appreciated.


More information about the freebsd-hackers mailing list