linux/include
Jared Hulbert b379d79019 mm: introduce VM_MIXEDMAP
This series introduces some important infrastructure work.  The overall result
is that:

1. We now support XIP backed filesystems using memory that have no
   struct page allocated to them. And patches 6 and 7 actually implement
   this for s390.

   This is pretty important in a number of cases. As far as I understand,
   in the case of virtualisation (eg. s390), each guest may mount a
   readonly copy of the same filesystem (eg. the distro). Currently,
   guests need to allocate struct pages for this image. So if you have
   100 guests, you already need to allocate more memory for the struct
   pages than the size of the image. I think. (Carsten?)

   For other (eg. embedded) systems, you may have a very large non-
   volatile filesystem. If you have to have struct pages for this, then
   your RAM consumption will go up proportionally to fs size. Even
   though it is just a small proportion, the RAM can be much more costly
   eg in terms of power, so every KB less that Linux uses makes it more
   attractive to a lot of these guys.

2. VM_MIXEDMAP allows us to support mappings where you actually do want
   to refcount _some_ pages in the mapping, but not others, and support
   COW on arbitrary (non-linear) mappings. Jared needs this for his NVRAM
   filesystem in progress. Future iterations of this filesystem will
   most likely want to migrate pages between pagecache and XIP backing,
   which is where the requirement for mixed (some refcounted, some not)
   comes from.

3. pte_special also has a peripheral usage that I need for my lockless
   get_user_pages patch. That was shown to speed up "oltp" on db2 by
   10% on a 2 socket system, which is kind of significant because they
   scrounge for months to try to find 0.1% improvement on these
   workloads. I'm hoping we might finally be faster than AIX on
   pSeries with this :). My reference to lockless get_user_pages is not
   meant to justify this patchset (which doesn't include lockless gup),
   but just to show that pte_special is not some s390 specific thing that
   should be hidden in arch code or xip code: I definitely want to use it
   on at least x86 and powerpc as well.

This patch:

Introduce a new type of mapping, VM_MIXEDMAP.  This is unlike VM_PFNMAP in
that it can support COW mappings of arbitrary ranges including ranges without
struct page *and* ranges with a struct page that we actually want to refcount
(PFNMAP can only support COW in those cases where the un-COW-ed translations
are mapped linearly in the virtual address, and can only support non
refcounted ranges).

VM_MIXEDMAP achieves this by refcounting all pfn_valid pages, and not
refcounting !pfn_valid pages (which is not an option for VM_PFNMAP, because it
needs to avoid refcounting pfn_valid pages eg.  for /dev/mem mappings).

Signed-off-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Cc: Jared Hulbert <jaredeh@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 08:58:22 -07:00
..
acpi
asm-alpha generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
asm-arm ide: add struct ide_io_ports (take 3) 2008-04-27 15:38:32 +02:00
asm-avr32
asm-blackfin [Blackfin] arch: add include/boot .gitignore files 2008-04-25 08:29:11 +08:00
asm-cris ide: add struct ide_io_ports (take 3) 2008-04-27 15:38:32 +02:00
asm-frv frv: remove HARD_RESET_NOW() 2008-04-21 16:03:13 -07:00
asm-generic bitops: use __fls for fls64 on 64-bit archs 2008-04-26 19:21:16 +02:00
asm-h8300
asm-ia64 KVM: Rename VCPU_MP_STATE_* to KVM_MP_STATE_* 2008-04-27 12:04:13 +03:00
asm-m32r
asm-m68k Generic semaphore implementation 2008-04-17 10:42:34 -04:00
asm-m68knommu
asm-mips Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-generic-bitops-v3 2008-04-26 13:46:11 -07:00
asm-mn10300
asm-parisc generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
asm-powerpc KVM: ppc: PowerPC 440 KVM implementation 2008-04-27 18:21:39 +03:00
asm-ppc [POWERPC] 4xx: Fix duplicate phys_addr_t definition 2008-04-24 20:57:34 +10:00
asm-s390 KVM: s390: Improve pgste accesses 2008-04-27 12:01:00 +03:00
asm-sh generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
asm-sparc [SPARC64]: NUMA device infrastructure. 2008-04-23 23:32:16 -07:00
asm-sparc64 generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
asm-um
asm-v850
asm-x86 Merge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm 2008-04-27 10:13:52 -07:00
asm-xtensa
crypto [CRYPTO] aes: Export generic setkey 2008-04-21 10:19:34 +08:00
keys KEYS: Fix the comment to match the file name in rxrpc-type.h. 2008-04-21 22:43:55 +00:00
linux mm: introduce VM_MIXEDMAP 2008-04-28 08:58:22 -07:00
math-emu
media V4L/DVB (7677): saa7134: Add/fix Beholder entries 2008-04-24 14:09:46 -03:00
mtd
net IPv6 support for NFS server export caches 2008-04-23 16:13:36 -04:00
pcmcia
rdma
rxrpc
scsi [SCSI] rework scsi_target allocation 2008-04-22 15:16:31 -05:00
sound [ALSA] Define MPU401 registers in sound/mpu401_uart.h 2008-04-24 12:38:22 +02:00
video
xen xen: add balloon driver 2008-04-24 23:57:33 +02:00
Kbuild