]> Zhao Yanbai Git Server - minix.git/commitdiff
Removed racy COW optimization
authorTomas Hruby <tom@minix3.org>
Fri, 18 Jun 2010 12:46:18 +0000 (12:46 +0000)
committerTomas Hruby <tom@minix3.org>
Fri, 18 Jun 2010 12:46:18 +0000 (12:46 +0000)
- enabling writing in COW once phys block is reference only once is racy if VM
  is preemptible. original memory location may get overwritten before COW copies
  the memory

- problem when DEBUG_RACE is on and a big problem for SMP

servers/vm/region.c

index 9a9f18c0f7d372b44e263c28c8c79a03af39e0f5..c9299d9224db9ae4dfbb8cf56183d270055d8b27 100644 (file)
@@ -556,21 +556,6 @@ PUBLIC void pb_unreferenced(struct vir_region *region, struct phys_region *pr)
                        panic("strange phys flags");
                }
                SLABFREE(pb);
-       } else {
-               struct phys_region *others;
-               int n = 0;
-
-               for(others = pb->firstregion; others;
-                       others = others->next_ph_list) {
-                       if(WRITABLE(region, others->ph)) {
-                               if(map_ph_writept(others->parent->parent,
-                                       others->parent, others) != OK) {
-                                       printf("VM: map_ph_writept failed unexpectedly\n");
-                               }
-                       } 
-                       n++;
-               }
-               assert(n == pb->refcount);
        }
 }