From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@linux-foundation.org
Cc: bernds_cb1@t-online.de, dhowells@redhat.com,
rgetz@blackfin.uclinux.org, vapier.adi@gmail.com,
lethal@linux-sh.org, linux-kernel@vger.kernel.org
Subject: [PATCH 00/10] Alter NOMMU mmap handling [ver #3]
Date: Thu, 08 Jan 2009 12:53:46 +0000 [thread overview]
Message-ID: <20090108125346.28454.90871.stgit@warthog.procyon.org.uk> (raw)
The primary change made by the attached patches alters the NOMMU mmap code so
that VMAs are per-MM rather than being a shared resource with separate per-MM
linkage blocks.
This solves two problems:
(1) In SYSV SHM where nattch for a segment does not reflect the number of
shmat's (and forks) done.
(2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an
exec'ing process when VM_EXECUTABLE is specified, regardless of the fact
that a VMA might be shared and already have its vm_mm assigned to another
process or even a dead process.
And adds a number of features:
(3) Allocations are now made with alloc_pages() rather than kmalloc(). This
simplifies page accounting within a block of pages.
(4) Excess pages can be trimmed from allocations.
(5) VMAs are added for the parent MM's RB-tree and mmap lists, as for MMU-mode
mmap.
(6) Non-anonymous VMAs can now be linked to the inode as for MMU-mode.
(7) mmaps can now be partially unmapped under some circumstances.
(8) Simplified coredumping in ELF-FDPIC.
(9) /proc/meminfo has a line "MmapCopy" that indicates the amount of private
copying mmap() has done.
There are some patches with secondary changes that do not relate to the primary
change:
(*) Ramfs needs to clean up correctly in the case where its get_unmapped_area
call gets fewer pages from find_get_pages() than were asked for.
(*) The askedalloc and realalloc variables are removed as nothing uses the
values computed.
(*) The ELF-FDPIC and FLAT binfmts no longer expand the stack segment to
consume the space that is allocated to them beyond what is asked for.
This removes some users of the contentious kobjsize().
An alternative method would be to to replace the call to kobjsize() with
something that uses the VMA list only.
(*) Fix kobjsize() to check the VMA list.
(*) Support XIP on initramfs under NOMMU conditions by pre-truncating the
ramfs files to get contiguous memory allocated in advance in the page
cache.
The patches can be obtained as a tarball from:
http://people.redhat.com/~dhowells/nommu-permmvmas.tar.bz2
And are available by GIT from:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-nommu.git
These patches have been tested on FRV, Blackfin and SH.
David
next reply other threads:[~2009-01-08 12:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 12:53 David Howells [this message]
2009-01-08 12:53 ` [PATCH 01/10] NOMMU: Fix cleanup handling in ramfs_nommu_get_umapped_area() " David Howells
2009-01-08 12:53 ` [PATCH 02/10] NOMMU: Rename ARM's struct vm_region " David Howells
2009-01-08 12:54 ` [PATCH 03/10] NOMMU: Delete askedalloc and realalloc variables " David Howells
2009-01-08 12:54 ` [PATCH 04/10] NOMMU: Make VMAs per MM as for MMU-mode linux " David Howells
2009-01-13 7:55 ` Andrew Morton
2009-01-13 10:51 ` David Howells
2009-01-08 12:54 ` [PATCH 05/10] NOMMU: Make mmap allocation page trimming behaviour configurable. " David Howells
2009-01-08 12:54 ` [PATCH 06/10] NOMMU: Improve procfs output using per-MM VMAs " David Howells
2009-01-08 12:54 ` [PATCH 07/10] FDPIC: Don't attempt to expand the userspace stack to fill the space allocated " David Howells
2009-01-08 12:54 ` [PATCH 08/10] FLAT: " David Howells
2009-01-08 12:54 ` [PATCH 09/10] NOMMU: Teach kobjsize() about VMA regions. " David Howells
2009-01-08 12:54 ` [PATCH 10/10] NOMMU: Support XIP on initramfs " 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=20090108125346.28454.90871.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bernds_cb1@t-online.de \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rgetz@blackfin.uclinux.org \
--cc=torvalds@osdl.org \
--cc=vapier.adi@gmail.com \
/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
all inboxes | Powered by JetHome®