linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: viro@ZenIV.linux.org.uk, vapier@gentoo.org, lethal@linux-sh.org
Cc: dhowells@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] NOMMU: Remove a superfluous check of vm_region::vm_usage
Date: Fri, 08 Jan 2010 22:05:28 +0000	[thread overview]
Message-ID: <20100108220527.23489.91998.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20100108220516.23489.11319.stgit@warthog.procyon.org.uk>

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)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2010-01-08 22:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 22:05 [PATCH 1/6] NOMMU: Fix SYSV SHM for NOMMU David Howells
2010-01-08 22:05 ` [PATCH 2/6] NOMMU: struct vm_region's vm_usage count need not be atomic David Howells
2010-01-08 22:05 ` David Howells [this message]
2010-01-08 22:05 ` [PATCH 4/6] NOMMU: Don't need get_unmapped_area() for NOMMU David Howells
2010-01-09  0:55   ` Mike Frysinger
2010-01-11 12:11   ` David Howells
2010-01-08 22:05 ` [PATCH 5/6] NOMMU: Fix race between ramfs truncation and shared mmap David Howells
2010-01-09  0:57   ` Mike Frysinger
2010-01-09  0:57   ` Mike Frysinger
2010-01-08 22:05 ` [PATCH 6/6] NOMMU: Fix shared mmap after truncate shrinkage problems David Howells
2010-01-08 22:10 ` [PATCH 1/6] NOMMU: Fix SYSV SHM for NOMMU David Howells
2010-01-14  5:36   ` Al Viro
2010-01-14 13:57   ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2010-01-14 13:58 David Howells
2010-01-14 13:58 ` [PATCH 3/6] NOMMU: Remove a superfluous check of vm_region::vm_usage David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100108220527.23489.91998.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vapier@gentoo.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).