Use OBJT_PHYS VM objects for kernel modules.

OBJT_DEFAULT incurs some unnecessary overhead given that kernel module
pages cannot be paged out.

Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D21862
This commit is contained in:
Mark Johnston 2019-10-02 16:34:42 +00:00
parent 551caa8741
commit 5131cba6d6
2 changed files with 2 additions and 3 deletions

View File

@ -991,7 +991,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
ef = (elf_file_t) lf;
#ifdef SPARSE_MAPPING
ef->object = vm_object_allocate(OBJT_DEFAULT, mapsize >> PAGE_SHIFT);
ef->object = vm_object_allocate(OBJT_PHYS, atop(mapsize));
if (ef->object == NULL) {
error = ENOMEM;
goto out;

View File

@ -774,8 +774,7 @@ link_elf_load_file(linker_class_t cls, const char *filename,
* This stuff needs to be in a single chunk so that profiling etc
* can get the bounds and gdb can associate offsets with modules
*/
ef->object = vm_object_allocate(OBJT_DEFAULT,
round_page(mapsize) >> PAGE_SHIFT);
ef->object = vm_object_allocate(OBJT_PHYS, atop(round_page(mapsize)));
if (ef->object == NULL) {
error = ENOMEM;
goto out;