[PATCH] vmacct7/9 update overcommit doc and comment

From: Hugh Dickins (hugh@veritas.com)
Date: Mon Jul 29 2002 - 17:13:21 EST


Update Doc and remove FIXME comment from fork.c now accounting right.

--- vmacct6/Documentation/vm/overcommit-accounting Mon Jul 29 11:48:01 2002
+++ vmacct7/Documentation/vm/overcommit-accounting Mon Jul 29 19:23:46 2002
@@ -37,13 +37,13 @@
 The overcommit is based on the following rules
 
 For a file backed map
- SHARED or READ only - 0 cost (the file is the map not swap)
+ SHARED or READ-only - 0 cost (the file is the map not swap)
+ PRIVATE WRITABLE - size of mapping per instance
 
- WRITABLE SHARED - size of mapping per instance
-
-For a direct map
- SHARED or READ only - size of mapping
- PRIVATE WRITEABLE - size of mapping per instance
+For an anonymous or /dev/zero map
+ SHARED - size of mapping
+ PRIVATE READ-only - 0 cost (but of little use)
+ PRIVATE WRITABLE - size of mapping per instance
 
 Additional accounting
         Pages made writable copies by mmap
@@ -66,5 +66,3 @@
 To Do
 -----
 o Account ptrace pages (this is hard)
-o Account for shared anonymous mappings properly
- - right now we account them per instance
--- vmacct6/kernel/fork.c Mon Jul 29 11:48:04 2002
+++ vmacct7/kernel/fork.c Mon Jul 29 19:23:46 2002
@@ -210,17 +210,12 @@
                 retval = -ENOMEM;
                 if(mpnt->vm_flags & VM_DONTCOPY)
                         continue;
-
- /*
- * FIXME: shared writable map accounting should be one off
- */
                 if (mpnt->vm_flags & VM_ACCOUNT) {
                         unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
                         if (!vm_enough_memory(len))
                                 goto fail_nomem;
                         charge += len;
                 }
-
                 tmp = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
                 if (!tmp)
                         goto fail_nomem;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:34 EST