HP-UX HB v13.00 Ch-22 - Performance and Tuning

HP-UX Handbook Rev 13.00 Page 6 (of 19)
Chapter 22 Performance & Tuning
October 29, 2013
How Memory is Mapped in HP UX
Kernel Address Space Layout
In kernel mode the process context space registers ( sr4-sr7) need to be set to kernel context.
This allows the kernel to access its virtual address space using short pointers.
Quadrant 1
Unlike user processes, all the kernel text and data reside in Quadrant 1. Quadrant 2 does not
contain a private area used for data. The kernel is privileged and its text and data are sharable
amongst the various subsystems, as a result there is no need for specific space for private and
shared data.
The 32- bit the virtual addresses in Quadrant 1 are managed by the sysmap_32bit resource map,
for 64-bit sysmap_64bit manages the resource map. The kernel text and data reside in space id
KERNELSPACE, this is currently defined as 0. The zero value was selected to allow
equivalently mapped addresses .
Space register 4 (sr4) will be set to 0 when running in kernel mode.
Quadrant 2
The majority of Quadrant 2 is unused for kernel address space. The kernel sets is process”
context space register to 5 (sr5) to point to the Uarea space id of the currently running thread.
This allows the kernel to access the process context and threads using short pointers.
As of HP-UX 11i, the Uarea takes up 16 memory pages of virtual address space. For 32-bit
kernels the Uarea starts at address 0x7FFF0000, for 64-bit the Uarea starts at 0x400003FF
FFFF0000. While 16 pages have been reserved for virtual addresses, currently only 4 pages are
allocated for 32 bit and 8 pages for 64-bit Uarea.
Quadrant 3
In Quadrant 3, the kernels space register is set to 6 (sr6) and points to the buffer cache, i.e.
sr6=bufcache_spacid. All of the virtual address assignments for the buffer cache/file cache are
in Quadrant 3. The kernel utilizes a bitmap called bufmap for 64-bit and bufmap2 for 32-bit to
manage the virtual addresses in Quadrant 3. Remaining memory can be allocated to shared
object memory calls.
Quadrant 4
In kernel mode Quadrant 4 virtual addresses are primarily used for kernel I/O. For 32-bit kernel
I/O addresses and user I/O addresses are the same. They both reside in space id 0. 64-bit kernel
running, kernel I/O addresses and user addresses are not the same. Kernel I/O space id is 0 , and
user I/O uses a different space id , if both kernel and user I/O needs to reference the same page ,
I/O aliasing must be done.