Commit de16834e authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[PATCH] update overcommit doc and comment

Update Doc and remove FIXME comment from fork.c now accounting right.
parent e054680b
......@@ -37,13 +37,13 @@ How It Works
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 @@ o Implement actual limit enforcement
To Do
-----
o Account ptrace pages (this is hard)
o Account for shared anonymous mappings properly
- right now we account them per instance
......@@ -210,17 +210,12 @@ static inline int dup_mmap(struct mm_struct * mm)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment