diff --git a/en_US.ISO8859-1/books/faq/book.sgml b/en_US.ISO8859-1/books/faq/book.sgml index 50e86c084f..938a08b091 100644 --- a/en_US.ISO8859-1/books/faq/book.sgml +++ b/en_US.ISO8859-1/books/faq/book.sgml @@ -10896,75 +10896,25 @@ panic: page fault - How can I increase or reduce the kernel address space? + How can I increase or reduce the kernel address space on i386? - By default, the kernel address space is 256 MB on - FreeBSD 3.X and 1 GB on FreeBSD 4.X. If you run a - network-intensive server (e.g. a large FTP or HTTP server), - you might find that 256 MB is not enough. + By default, the kernel address space is 1 GB + (2 GB for PAE) for i386. If you run a + network-intensive server (e.g. a large FTP or HTTP server), + or you want to use ZFS, you might find that is not + enough. - So how do you increase the address space? There are two - aspects to this. First, you need to tell the kernel to reserve - a larger portion of the address space for itself. Second, since - the kernel is loaded at the top of the address space, you need - to lower the load address so it does not bump its head against - the ceiling. + Add the following line to your kernel configuration file + to increase available space and rebuild your kernel: - The first goal is achieved by increasing the value of - NKPDE in - src/sys/i386/include/pmap.h. Here is what - it looks like for a 1 GB address space: + options KVA_PAGES=N - #ifndef NKPDE -#ifdef SMP -#define NKPDE 254 /* addressable number of page tables/pde's */ -#else -#define NKPDE 255 /* addressable number of page tables/pde's */ -#endif /* SMP */ -#endif - - To find the correct value of NKPDE, - divide the desired address space size (in megabytes) by four, - then subtract one for UP and two for SMP. - - To achieve the second goal, you need to compute the - correct load address: simply subtract the address space size - (in bytes) from 0x100100000; the result is 0xc0100000 for a 1 - GB address space. Set LOAD_ADDRESS in - src/sys/i386/conf/Makefile.i386 to that - value; then set the location counter in the beginning of the - section listing in - src/sys/i386/conf/kernel.script to the - same value, as follows: - - OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") -OUTPUT_ARCH(i386) -ENTRY(btext) -SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/obj/elf/home/src/tmp/usr/i386-unknown-freebsdelf/lib); -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0xc0100000 + SIZEOF_HEADERS; - .interp : { *(.interp) } - - Then reconfig and rebuild your kernel. You will - probably have problems with &man.ps.1; &man.top.1; and the - like; make world should take care of it - (or a manual rebuild of libkvm, - &man.ps.1; and &man.top.1; after copying the patched - pmap.h to - /usr/include/vm/. - - NOTE: the size of the kernel address space must be a - multiple of four megabytes. - - [&a.dg; adds: I think the kernel address space - needs to be a power of two, but I am not certain about that. The - old(er) boot code used to monkey with the high order address bits - and I think expected at least 256MB - granularity.] + To find the correct value of + N, divide the desired address + space size (in megabytes) by four. (For example, it is + 512 for 2 GB.)