Bug fix
authorDavid Katz <dgk8293@vt.edu>
Sun, 18 May 2014 17:22:56 +0000 (13:22 -0400)
committerDavid Katz <dgk8293@vt.edu>
Sun, 18 May 2014 17:22:56 +0000 (13:22 -0400)
include/linux/process_server.h
kernel/process_server.c
mm/mmap.c

index ba78551..0589f4c 100644 (file)
@@ -26,8 +26,8 @@
 //#define PROCESS_SERVER_USE_KMOD
 #undef PROCESS_SERVER_USE_KMOD
 
-//#define PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
-#undef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
+#define PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
+//#undef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
 
 //#define PROCESS_SERVER_USE_HEAVY_LOCK
 #undef PROCESS_SERVER_USE_HEAVY_LOCK
index cd0af8e..38b08ea 100644 (file)
@@ -6859,14 +6859,15 @@ int process_server_pull_remote_mappings(struct mm_struct *mm,
     unsigned long long fault_processing_time = 0;
 #endif
 
-    current->enable_distributed_munmap = 0;
-    current->enable_do_mmap_pgoff_hook = 0;
 
     // Nothing to do for a thread group that's not distributed.
     if(!current->tgroup_distributed) {
         goto not_handled_no_perf;
     }
 
+    current->enable_distributed_munmap = 0;
+    current->enable_do_mmap_pgoff_hook = 0;
+    
     perf = PERF_MEASURE_START(&perf_process_server_try_handle_mm_fault);
 
 #ifdef PROCESS_SERVER_HOST_PROC_ENTRY
@@ -7298,7 +7299,7 @@ not_handled:
     return ret;
 
 not_handled_no_perf:
-
+    
     return 0;
 }
 
index 905ec4d..3ec6042 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1008,9 +1008,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
                                                             0);
             if(fault_ret) {
                 pserv_conflict = 1;
- #ifdef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
+#ifdef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
 #ifdef PROCESS_SERVER_USE_HEAVY_LOCK
-                process_server_use_heavy_lock();
+                process_server_release_heavy_lock();
 #else
                 process_server_release_page_lock_range(addr,len);
 #endif
@@ -1023,8 +1023,17 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
             }
         } while(pserv_conflict);
     }
-       if (addr & ~PAGE_MASK)
+       if (addr & ~PAGE_MASK) {
+        if(range_locked) {
+#ifdef PROCESS_SERVER_USE_HEAVY_LOCK
+            process_server_release_heavy_lock();
+#else  
+            process_server_release_page_lock_range(addr,len);
+#endif
+
+        }
                return addr;
+    }
 
 #ifdef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
     if(current->enable_do_mmap_pgoff_hook && !range_locked) {