disable demand paging on ANONYMOUS mappings unless anon_on_demand kernel argument is passed
This commit is contained in:
@@ -66,4 +66,6 @@ static inline int page_is_multi_mapped(struct page *page)
|
|||||||
return (ihk_atomic_read(&page->count) > 1);
|
return (ihk_atomic_read(&page->count) > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Should we take page faults on ANONYMOUS mappings? */
|
||||||
|
extern int anon_on_demand;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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];
|
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)
|
static void reserve_pages(unsigned long start, unsigned long end, int type)
|
||||||
{
|
{
|
||||||
if (start < pa_start) {
|
if (start < pa_start) {
|
||||||
@@ -681,6 +683,11 @@ void mem_init(void)
|
|||||||
|
|
||||||
/* Prepare the kernel virtual map space */
|
/* Prepare the kernel virtual map space */
|
||||||
virtual_allocator_init();
|
virtual_allocator_init();
|
||||||
|
|
||||||
|
if (find_command_line("anon_on_demand")) {
|
||||||
|
kprintf("Demand paging on ANONYMOUS mappings enabled.\n");
|
||||||
|
anon_on_demand = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct location {
|
struct location {
|
||||||
|
|||||||
@@ -1078,7 +1078,9 @@ SYSCALL_DECLARE(mmap)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
vrflags |= VR_DEMAND_PAGING;
|
if (anon_on_demand) {
|
||||||
|
vrflags |= VR_DEMAND_PAGING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user