original_kernel/include/asm-powerpc
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
..
iseries
8253pit.h
a.out.h
abs_addr.h [PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc 2005-11-10 11:24:04 +11:00
agp.h
asm-compat.h [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
atomic.h [PATCH] atomic: inc_not_zero 2005-11-13 18:14:16 -08:00
auxvec.h [PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel 2005-11-11 22:25:39 +11:00
backlight.h
bitops.h [FLS64]: generic version 2006-01-03 13:11:06 -08:00
btext.h powerpc: Move a bunch of ppc64 headers to include/asm-powerpc 2005-11-14 17:22:01 +11:00
bug.h [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
bugs.h
byteorder.h
cache.h [PATCH] powerpc: Merge cacheflush.h and cache.h 2005-11-10 13:09:22 +11:00
cacheflush.h [PATCH] powerpc: Merge cacheflush.h and cache.h 2005-11-10 13:09:22 +11:00
checksum.h
compat.h [PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc 2005-11-10 11:24:04 +11:00
cputable.h [PATCH] powerpc: merge align.c 2005-11-18 14:39:23 +11:00
cputime.h
current.h [PATCH] powerpc: Merge current.h 2005-11-10 11:23:53 +11:00
dbdma.h
delay.h powerpc: Fix delay functions for 601 processors 2005-11-18 14:08:12 +11:00
div64.h
dma-mapping.h powerpc: merge dma-mapping.h 2005-11-19 01:48:52 +11:00
dma.h
eeh.h [PATCH] Avoid use of uninitialised spinlock in EEH. 2005-11-17 16:53:38 +11:00
eeh_event.h [PATCH] ppc64: PCI error event dispatcher 2005-11-10 11:38:05 +11:00
elf.h [PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel 2005-11-11 22:25:39 +11:00
emergency-restart.h
errno.h
fcntl.h
firmware.h [PATCH] powerpc: merge code values for identifying platforms 2005-11-10 13:37:51 +11:00
floppy.h powerpc: Move a bunch of ppc64 headers to include/asm-powerpc 2005-11-14 17:22:01 +11:00
futex.h [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
grackle.h
hardirq.h
heathrow.h
hvcall.h [PATCH] powerpc: Move more ppc64 files with no ppc32 equivalent to powerpc 2005-11-10 15:32:37 +11:00
hvconsole.h powerpc: Move a bunch of ppc64 headers to include/asm-powerpc 2005-11-14 17:22:01 +11:00
hvcserver.h powerpc: Move a bunch of ppc64 headers to include/asm-powerpc 2005-11-14 17:22:01 +11:00
hw_irq.h ppc64: remove ppc_irq_dispatch_handler 2005-11-09 16:19:53 +11:00
i8259.h
ide.h powerpc: merge ide.h 2005-11-08 12:20:34 +11:00
io.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
ioctl.h
ioctls.h
iommu.h [PATCH] powerpc: update my email address 2005-11-23 21:23:20 +11:00
ipc.h
ipcbuf.h
irq.h [PATCH] ppc32: fix PQ2 PCI DMA interrupt handling 2005-11-11 22:19:56 +11:00
kdebug.h
kexec.h [PATCH] powerpc: Export htab start/end via device tree 2005-11-14 16:34:06 +11:00
keylargo.h
kmap_types.h
kprobes.h [PATCH] Kprobes: Track kprobe on a per_cpu basis - ppc64 changes 2005-11-07 07:53:45 -08:00
linkage.h
lmb.h
local.h
lppaca.h [PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc 2005-11-10 11:24:04 +11:00
machdep.h [PATCH] powerpc: Turn cpu_irq_down into kexec_cpu_down 2005-11-14 16:33:09 +11:00
macio.h
mc146818rtc.h
mediabay.h
mman.h [PATCH] madvise(MADV_REMOVE): remove pages from tmpfs shm backing store 2006-01-06 08:33:22 -08:00
mmu.h [PATCH] powerpc: Add missing icache flushes for hugepages 2005-12-09 16:30:48 +11:00
mmu_context.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
mmzone.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
module.h
mpic.h
msgbuf.h
namei.h
numnodes.h
nvram.h powerpc: Remove an extraneous and incorrect declaration of pmac_nvram_init. 2005-11-15 11:17:02 +11:00
of_device.h
ohare.h
oprofile_impl.h
pSeries_reconfig.h
paca.h [PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc 2005-11-10 11:24:04 +11:00
page.h [PATCH] powerpc: Merge page.h 2005-11-14 16:33:05 +11:00
page_32.h powerpc: Fix 32-bit compile: PPC_MEMSTART was undeclared 2005-11-14 17:32:50 +11:00
page_64.h [PATCH] powerpc: More hugepage boundary case fixes 2005-11-25 22:12:45 +11:00
param.h
parport.h
pci-bridge.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
pci.h powerpc: Merge pci.h 2005-11-19 20:46:04 +11:00
percpu.h
pgalloc.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
pgtable-4k.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
pgtable-64k.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
pgtable.h powerpc: Trivially merge several headers from asm-ppc64 to asm-powerpc 2005-11-19 20:17:32 +11:00
pmac_feature.h
pmac_low_i2c.h
pmc.h [PATCH] ppc32: fix perf_irq extern on e500 2005-11-09 07:55:52 -08:00
poll.h
posix_types.h
ppc-pci.h powerpc: Merge pci.h 2005-11-19 20:46:04 +11:00
ppc_asm.h [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
processor.h [PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel 2005-11-11 22:25:39 +11:00
prom.h [PATCH] ppc64: SMU partition recovery 2005-11-08 11:17:40 +11:00
ptrace.h
reg.h [PATCH] powerpc: merge code values for identifying platforms 2005-11-10 13:37:51 +11:00
reg_8xx.h [PATCH] powerpc: Merge cacheflush.h and cache.h 2005-11-10 13:09:22 +11:00
resource.h
rtas.h
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
semaphore.h
sembuf.h
serial.h powerpc: Move a bunch of ppc64 headers to include/asm-powerpc 2005-11-14 17:22:01 +11:00
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h [PATCH] powerpc: Merge signal.h 2005-11-10 11:23:46 +11:00
smp.h powerpc: Various UP build fixes 2005-11-07 13:18:13 +11:00
smu.h [PATCH] ppc64: SMU partition recovery 2005-11-08 11:17:40 +11:00
socket.h
sockios.h
sparsemem.h [PATCH] ppc64: Increase sparsemem defaults 2005-11-11 22:21:41 +11:00
spinlock.h powerpc: Merge spinlock.h 2005-11-19 20:50:46 +11:00
spinlock_types.h
sstep.h
stat.h
statfs.h
string.h
synch.h
system.h powerpc: Move some extern declarations from C code into headers 2005-11-10 15:53:40 +11:00
tce.h [PATCH] powerpc: update my email address 2005-11-23 21:23:20 +11:00
termbits.h
termios.h
thread_info.h
time.h
timex.h
tlb.h
tlbflush.h
topology.h [PATCH] powerpc: Fix typo in topology.h 2005-11-18 13:18:11 +11:00
types.h
uaccess.h [PATCH] powerpc: Consolidate asm compatibility macros 2005-11-10 13:10:38 +11:00
ucontext.h
udbg.h [PATCH] powerpc: Move udbg code to arch/powerpc 2005-11-11 22:23:34 +11:00
unaligned.h
uninorth.h
unistd.h
user.h
vdso.h [PATCH] powerpc: Make the vDSO functions set error code (#2) 2005-11-16 14:05:11 +11:00
vdso_datapage.h [PATCH] powerpc: vdso fixes (take #2) 2005-11-14 16:35:58 +11:00
vga.h
vio.h
xmon.h powerpc: Simplify and clean up the xmon terminal I/O 2005-11-08 22:55:08 +11:00
xor.h