disable demand paging on ANONYMOUS mappings unless anon_on_demand kernel argument is passed

This commit is contained in:
Balazs Gerofi
2015-09-14 17:26:37 +09:00
parent 69f4b0e1ad
commit e1a01803d0
3 changed files with 12 additions and 1 deletions

View File

@ -66,4 +66,6 @@ static inline int page_is_multi_mapped(struct page *page)
return (ihk_atomic_read(&page->count) > 1);
}
/* Should we take page faults on ANONYMOUS mappings? */
extern int anon_on_demand;
#endif

View File

@ -56,6 +56,8 @@ extern int ihk_mc_pt_print_pte(struct page_table *pt, void *virt);
struct tlb_flush_entry tlb_flush_vector[IHK_TLB_FLUSH_IRQ_VECTOR_SIZE];
int anon_on_demand = 0;
static void reserve_pages(unsigned long start, unsigned long end, int type)
{
if (start < pa_start) {
@ -681,6 +683,11 @@ void mem_init(void)
/* Prepare the kernel virtual map space */
virtual_allocator_init();
if (find_command_line("anon_on_demand")) {
kprintf("Demand paging on ANONYMOUS mappings enabled.\n");
anon_on_demand = 1;
}
}
struct location {

View File

@ -1078,7 +1078,9 @@ SYSCALL_DECLARE(mmap)
}
#endif
else {
vrflags |= VR_DEMAND_PAGING;
if (anon_on_demand) {
vrflags |= VR_DEMAND_PAGING;
}
}
}
else {