From: David Howells <dhowells@redhat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix nommu MAP_SHARED handling
Date: Wed, 15 Dec 2004 15:38:36 +0000 [thread overview]
Message-ID: <2272.1103125116@redhat.com> (raw)
In-Reply-To: <2149.1103124772@redhat.com>
The attached patch includes prio-tree support and adds cross-referencing of
VMAs with address spaces back in, as is done under normal MMU Linux.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat nommu-prio-2610rc3.diff
Makefile | 4 ++--
nommu.c | 22 ++++++++++++++++++----
2 files changed, 20 insertions(+), 6 deletions(-)
diff -uNrp linux-2.6.10-rc3-mm1-nommu-rb/mm/Makefile linux-2.6.10-rc3-mm1-nommu-prio/mm/Makefile
--- linux-2.6.10-rc3-mm1-nommu-rb/mm/Makefile 2004-12-13 17:34:22.000000000 +0000
+++ linux-2.6.10-rc3-mm1-nommu-prio/mm/Makefile 2004-12-15 13:38:04.000000000 +0000
@@ -5,12 +5,12 @@
mmu-y := nommu.o
mmu-$(CONFIG_MMU) := fremap.o highmem.o madvise.o memory.o mincore.o \
mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \
- vmalloc.o prio_tree.o
+ vmalloc.o
obj-y := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
page_alloc.o page-writeback.o pdflush.o \
readahead.o slab.o swap.o truncate.o vmscan.o \
- $(mmu-y)
+ prio_tree.o $(mmu-y)
obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o
obj-$(CONFIG_HUGETLBFS) += hugetlb.o
diff -uNrp linux-2.6.10-rc3-mm1-nommu-rb/mm/nommu.c linux-2.6.10-rc3-mm1-nommu-prio/mm/nommu.c
--- linux-2.6.10-rc3-mm1-nommu-rb/mm/nommu.c 2004-12-15 14:32:07.000000000 +0000
+++ linux-2.6.10-rc3-mm1-nommu-prio/mm/nommu.c 2004-12-15 13:38:04.000000000 +0000
@@ -48,10 +48,6 @@ DECLARE_RWSEM(nommu_vma_sem);
struct vm_operations_struct generic_file_vm_ops = {
};
-void __init prio_tree_init(void)
-{
-}
-
/*
* Handle all mappings that got truncated by a "truncate()"
* system call.
@@ -319,6 +315,15 @@ static void add_nommu_vma(struct vm_area
struct rb_node **p = &nommu_vma_tree.rb_node;
struct rb_node *parent = NULL;
+ /* add the VMA to the mapping */
+ if (vma->vm_file) {
+ mapping = vma->vm_file->f_mapping;
+
+ flush_dcache_mmap_lock(mapping);
+ vma_prio_tree_insert(vma, &mapping->i_mmap);
+ flush_dcache_mmap_unlock(mapping);
+ }
+
/* add the VMA to the master list */
while (*p) {
parent = *p;
@@ -353,6 +358,15 @@ static void delete_nommu_vma(struct vm_a
{
struct address_space *mapping;
+ /* remove the VMA from the mapping */
+ if (vma->vm_file) {
+ mapping = vma->vm_file->f_mapping;
+
+ flush_dcache_mmap_lock(mapping);
+ vma_prio_tree_remove(vma, &mapping->i_mmap);
+ flush_dcache_mmap_unlock(mapping);
+ }
+
/* remove from the master list */
rb_erase(&vma->vm_rb, &nommu_vma_tree);
}
next prev parent reply other threads:[~2004-12-15 15:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-15 15:32 [PATCH] Fix nommu MAP_SHARED handling David Howells
2004-12-15 15:38 ` David Howells [this message]
2004-12-15 15:54 ` [PATCH] Permit nommu MAP_SHARED of memory backed files David Howells
2004-12-15 15:55 ` [PATCH] Cross-reference nommu VMAs with mappings 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=2272.1103125116@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.