lkml.org 
[lkml]   [2010]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/6] NOMMU: Remove a superfluous check of vm_region::vm_usage
Date
In split_vma(), there's no need to check if the VMA being split has a region
that's in use by more than one VMA because:

(1) The preceding test prohibits splitting of non-anonymous VMAs and regions
(eg: file or chardev backed VMAs).

(2) Anonymous regions can't be mapped multiple times because there's no handle
by which to refer to the already existing region.

(3) If a VMA has previously been split, then the region backing it has also
been split into two regions, each of usage 1.

Signed-off-by: David Howells <dhowells@redhat.com>
---

mm/nommu.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/mm/nommu.c b/mm/nommu.c
index 5e39294..d6dd656 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1441,10 +1441,9 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,

kenter("");

- /* we're only permitted to split anonymous regions that have a single
- * owner */
- if (vma->vm_file ||
- vma->vm_region->vm_usage != 1)
+ /* we're only permitted to split anonymous regions (these should have
+ * only a single usage on the region) */
+ if (vma->vm_file)
return -ENOMEM;

if (mm->map_count >= sysctl_max_map_count)


\
 
 \ /
  Last update: 2010-01-08 23:09    [W:0.383 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site