From ff7a6dae1e8a6a4d5ce4591b682116e22e76dc18 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 20 Aug 2015 13:43:01 +0200 Subject: yyy avoid unlocking while zeroing or copying --- vm/vm_fault.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'vm/vm_fault.c') diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 40d1cbc..1ed9e03 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -462,15 +462,16 @@ vm_fault_return_t vm_fault_page( m = real_m; /* - * Drop the lock while zero filling - * page. Then break because this - * is the page we wanted. Checking - * the page lock is a waste of time; - * this page was either absent or - * newly allocated -- in both cases - * it can't be page locked by a pager. + * Zero fill the page. Then + * break because this is the + * page we wanted. Checking + * the page lock is a waste + * of time; this page was + * either absent or newly + * allocated -- in both cases + * it can't be page locked by + * a pager. */ - vm_object_unlock(object); vm_page_zero_fill(m); @@ -478,7 +479,6 @@ vm_fault_return_t vm_fault_page( vm_stat.zero_fill_count++; current_task()->zero_fills++; - vm_object_lock(object); pmap_clear_modify(m->phys_addr); break; } else { @@ -755,12 +755,10 @@ vm_fault_return_t vm_fault_page( return(VM_FAULT_MEMORY_SHORTAGE); } - vm_object_unlock(object); vm_page_zero_fill(m); vm_stat_sample(SAMPLED_PC_VM_ZFILL_FAULTS); vm_stat.zero_fill_count++; current_task()->zero_fills++; - vm_object_lock(object); pmap_clear_modify(m->phys_addr); break; } @@ -841,9 +839,7 @@ vm_fault_return_t vm_fault_page( return(VM_FAULT_MEMORY_SHORTAGE); } - vm_object_unlock(object); vm_page_copy(m, copy_m); - vm_object_lock(object); /* * If another map is truly sharing this -- cgit v1.2.3