kernel-ark/include/asm-arm
Badari Pulavarty f6b3ec238d [PATCH] madvise(MADV_REMOVE): remove pages from tmpfs shm backing store
Here is the patch to implement madvise(MADV_REMOVE) - which frees up a
given range of pages & its associated backing store.  Current
implementation supports only shmfs/tmpfs and other filesystems return
-ENOSYS.

"Some app allocates large tmpfs files, then when some task quits and some
client disconnect, some memory can be released.  However the only way to
release tmpfs-swap is to MADV_REMOVE". - Andrea Arcangeli

Databases want to use this feature to drop a section of their bufferpool
(shared memory segments) - without writing back to disk/swap space.

This feature is also useful for supporting hot-plug memory on UML.

Concerns raised by Andrew Morton:

- "We have no plan for holepunching!  If we _do_ have such a plan (or
  might in the future) then what would the API look like?  I think
  sys_holepunch(fd, start, len), so we should start out with that."

- Using madvise is very weird, because people will ask "why do I need to
  mmap my file before I can stick a hole in it?"

- None of the other madvise operations call into the filesystem in this
  manner.  A broad question is: is this capability an MM operation or a
  filesytem operation?  truncate, for example, is a filesystem operation
  which sometimes has MM side-effects.  madvise is an mm operation and with
  this patch, it gains FS side-effects, only they're really, really
  significant ones."

Comments:

- Andrea suggested the fs operation too but then it's more efficient to
  have it as a mm operation with fs side effects, because they don't
  immediatly know fd and physical offset of the range.  It's possible to
  fixup in userland and to use the fs operation but it's more expensive,
  the vmas are already in the kernel and we can use them.

Short term plan &  Future Direction:

- We seem to need this interface only for shmfs/tmpfs files in the short
  term.  We have to add hooks into the filesystem for correctness and
  completeness.  This is what this patch does.

- In the future, plan is to support both fs and mmap apis also.  This
  also involves (other) filesystem specific functions to be implemented.

- Current patch doesn't support VM_NONLINEAR - which can be addressed in
  the future.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Andrea Arcangeli <andrea@suse.de>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-06 08:33:22 -08:00
..
arch-aaec2000
arch-cl7500
arch-clps711x
arch-ebsa110
arch-ebsa285
arch-epxa10db
arch-h720x
arch-imx
arch-integrator
arch-iop3xx
arch-ixp4xx
arch-ixp2000
arch-l7200
arch-lh7a40x
arch-omap
arch-pxa [PATCH] USB: pxa27x OHCI - Separate platform code from main driver 2006-01-04 13:48:28 -08:00
arch-realview
arch-rpc
arch-s3c2410 [ARM] 3178/1: S3C2400 - adds GPIO registers definitions to regs-gpio.h 2005-11-28 18:08:43 +00:00
arch-sa1100
arch-shark
arch-versatile
hardware
mach
a.out.h
apm.h
assembler.h
atomic.h
auxvec.h
bitops.h [FLS64]: generic version 2006-01-03 13:11:06 -08:00
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h
cpu-multi32.h
cpu-single.h
cpu.h
cputime.h
current.h
delay.h
div64.h
dma-mapping.h
dma.h
domain.h
ecard.h
elf.h [ARM] 3205/1: Handle new EABI relocations when loading kernel modules. 2005-12-14 22:04:22 +00:00
emergency-restart.h
errno.h
fcntl.h
fiq.h
floppy.h
fpstate.h
futex.h
glue.h
hardirq.h
hardware.h
ide.h
io.h [ARM] 3191/1: Mark I/O pointer as const in __raw_reads[bwl] 2005-12-05 10:54:59 +00:00
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq.h
kmap_types.h
leds.h
limits.h
linkage.h
local.h
locks.h
mc146818rtc.h
memory.h [ARM] 3194/1: add pfn_to_kaddr macro for ARM take2 2005-12-05 10:55:00 +00:00
mman.h [PATCH] madvise(MADV_REMOVE): remove pages from tmpfs shm backing store 2006-01-06 08:33:22 -08:00
mmu_context.h
mmu.h
mmzone.h
module.h
msgbuf.h
mtd-xip.h
namei.h
numnodes.h
nwflash.h
page.h
param.h
parport.h
pci.h
percpu.h
pgalloc.h
pgtable.h
poll.h
posix_types.h
proc-fns.h
processor.h
procinfo.h
ptrace.h
resource.h
rtc.h
scatterlist.h
sections.h
segment.h
semaphore-helper.h
semaphore.h [ARM] sema_count() removal 2005-12-01 20:58:01 +00:00
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
sizes.h
smp.h
socket.h
sockios.h
spinlock_types.h
spinlock.h [ARM SMP] Use event instructions for spinlocks 2005-12-01 15:47:24 +00:00
stat.h
statfs.h
string.h
suspend.h
system.h
termbits.h
termios.h
therm.h
thread_info.h
timex.h
tlb.h
tlbflush.h
topology.h
traps.h
types.h
uaccess.h
ucontext.h
unaligned.h
unistd.h
user.h
vfp.h
vfpmacros.h
vga.h
xor.h