Page Coloring Manipulation
Alex Merritt
merritt.alex at gmail.com
Fri Apr 10 21:45:38 UTC 2015
Hello hackers,
I am interested in playing with the page-coloring support within the
virtual memory subsystem. Specifically:
i. Methods to specify the number of colors a task receives
ii. Methods to change the quantity of colors at runtime
iii. Understand what areas of memory coloring governs, e.g., just task
data/instructions, file-backed/anon, or even task page-table entries
created by the kernel?
Great if there are user-level methods, but not necessary. Does the kernel
determine these values automatically? Is it disabled by default or always
exercised?
Here is what I found thus far --
// during page fault, in vm_fault_hold()
#if VM_NRESERVLEVEL > 0
if ((fs.object->flags & OBJ_COLORED) == 0) {
fs.object->flags |= OBJ_COLORED;
fs.object->pg_color = atop(vaddr) -
fs.pindex;
}
#endif
// and in vm_object_init
#if VM_NRESERVLEVEL > 0
kernel_object->flags |= OBJ_COLORED;
kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS);
#endif
So it seems an object must be explicitly marked as "colorable", which is
true always? Please help me interpret.
I am new to FreeBSD hacking ;) and appreciate any pointers for me to study
further.
Thanks,
Alex
More information about the freebsd-hackers
mailing list