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:
parent
551caa8741
commit
5131cba6d6
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user