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 ...@@ -37,13 +37,13 @@ How It Works
The overcommit is based on the following rules The overcommit is based on the following rules
For a file backed map 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 an anonymous or /dev/zero map
SHARED - size of mapping
For a direct map PRIVATE READ-only - 0 cost (but of little use)
SHARED or READ only - size of mapping PRIVATE WRITABLE - size of mapping per instance
PRIVATE WRITEABLE - size of mapping per instance
Additional accounting Additional accounting
Pages made writable copies by mmap Pages made writable copies by mmap
...@@ -66,5 +66,3 @@ o Implement actual limit enforcement ...@@ -66,5 +66,3 @@ o Implement actual limit enforcement
To Do To Do
----- -----
o Account ptrace pages (this is hard) 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) ...@@ -210,17 +210,12 @@ static inline int dup_mmap(struct mm_struct * mm)
retval = -ENOMEM; retval = -ENOMEM;
if(mpnt->vm_flags & VM_DONTCOPY) if(mpnt->vm_flags & VM_DONTCOPY)
continue; continue;
/*
* FIXME: shared writable map accounting should be one off
*/
if (mpnt->vm_flags & VM_ACCOUNT) { if (mpnt->vm_flags & VM_ACCOUNT) {
unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
if (!vm_enough_memory(len)) if (!vm_enough_memory(len))
goto fail_nomem; goto fail_nomem;
charge += len; charge += len;
} }
tmp = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); tmp = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
if (!tmp) if (!tmp)
goto fail_nomem; 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