android_kernel_xiaomi_sm8350/include/asm-mips
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
..
arc
cobalt Resurrect Cobalt support for 2.6. 2005-10-29 19:30:42 +01:00
ddb5xxx [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
dec Use physical addresses at the interface level, letting drivers remap 2005-10-29 19:31:35 +01:00
galileo-boards
gcc
ip32 [MIPS] IP32: Fix sparse warnings. 2005-11-17 16:23:48 +00:00
it8172
jmr3927 Use new txx9 serial driver. 2005-10-29 19:30:52 +01:00
lasat [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
mach-atlas
mach-au1x00 [PATCH] ide: AU1200 IDE update 2005-12-15 02:17:46 +01:00
mach-db1x00 [MIPS] Add missing arch defines for the Alchemy MTD driver. 2005-11-17 16:23:42 +00:00
mach-ddb5074
mach-dec Use physical addresses at the interface level, letting drivers remap 2005-10-29 19:31:35 +01:00
mach-ev64120
mach-ev96100
mach-generic Redefine outs[wl] for ide_outs[wl]. 2005-11-07 18:05:40 +00:00
mach-ip22 Cleanup the mess in cpu_cache_init. 2005-10-29 19:32:32 +01:00
mach-ip27 Fix ARCH_KMALLOC_MINALIGN values on MIPS 2005-10-29 19:32:30 +01:00
mach-ip32 [MIPS] IP32: No need to include <asm/io.h>. 2005-11-17 16:23:44 +00:00
mach-ja Redo RM9000 workaround which along with other DSP ASE changes was 2005-10-29 19:31:23 +01:00
mach-jazz [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
mach-jmr3927 [MIPS] JMR3927: Fix include wrapper symbol. 2005-11-17 16:23:54 +00:00
mach-lasat
mach-mips Fixup a few lose ends in explicit support for MIPS R1/R2. 2005-10-29 19:32:37 +01:00
mach-ocelot
mach-ocelot3 Redo RM9000 workaround which along with other DSP ASE changes was 2005-10-29 19:31:23 +01:00
mach-pb1x00 [MIPS] Add missing arch defines for the Alchemy MTD driver. 2005-11-17 16:23:42 +00:00
mach-pnx8550 Philips PNX8550 support: MIPS32-like core with 2 Trimedias on it. 2005-10-29 19:31:54 +01:00
mach-qemu [MIPS] Qemu: Qemu is emulating a 1193.182kHz i8254 PIC. 2005-12-01 11:05:15 +00:00
mach-rm200 Cleanup the mess in cpu_cache_init. 2005-10-29 19:32:32 +01:00
mach-sibyte Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
mach-sim Cleanup the mess in cpu_cache_init. 2005-10-29 19:32:32 +01:00
mach-yosemite Redo RM9000 workaround which along with other DSP ASE changes was 2005-10-29 19:31:23 +01:00
mips-boards [MIPS] SEAD: More build fixes. 2005-11-17 16:23:57 +00:00
pci
sgi [PATCH] sgiseeq: Configure PIO and DMA timing requests. 2005-10-18 18:03:47 -04:00
sibyte Support for BigSur board. 2005-10-29 19:32:47 +01:00
sn Delete the SABLE_RTL case. 2005-10-29 19:32:19 +01:00
tx4927 [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
tx4938 Support for Toshiba's RBHMA4500 eval board for the TX4938. 2005-10-29 19:31:57 +01:00
vr41xx [PATCH] mips: add TANBAC TB0287 support 2005-09-09 13:57:30 -07:00
xtalk
8253pit.h
a.out.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
abi.h Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
addrspace.h Add support for SB1A CPU. 2005-10-29 19:32:46 +01:00
asm.h Fix build with CONFIG_PRINTK disabled. 2005-10-29 19:31:18 +01:00
asmmacro-32.h kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
asmmacro-64.h kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
asmmacro.h [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
atomic.h [MIPS] Fix documentation typos. 2005-11-17 16:23:49 +00:00
auxvec.h [PATCH] auxiliary vector cleanups 2005-09-07 16:57:21 -07:00
bcache.h
bitops.h [FLS64]: generic version 2006-01-03 13:11:06 -08:00
bootinfo.h Support for Toshiba's RBHMA4500 eval board for the TX4938. 2005-10-29 19:31:57 +01:00
branch.h
break.h Allocate break code 513 to KDB. 2005-10-29 19:30:34 +01:00
bug.h Fix weirdness in <asm/bug.h> 2005-10-29 19:32:38 +01:00
bugs.h Build fix for certain configurations. 2005-10-29 19:31:05 +01:00
byteorder.h
cache.h Fix ARCH_KMALLOC_MINALIGN values on MIPS 2005-10-29 19:32:30 +01:00
cachectl.h
cacheflush.h Better interface to run uncached cache setup code. 2005-10-29 19:31:11 +01:00
cacheops.h
checksum.h The type of sum in csum_tcpudp_nofold is "unsigned int", so when we assign 2005-10-29 19:32:25 +01:00
compat.h 2.6.14-rc1 updates for MIPS compat types. 2005-10-29 19:32:40 +01:00
compiler.h
cpu-features.h Cleanup the mess in cpu_cache_init. 2005-10-29 19:32:32 +01:00
cpu-info.h Cleanup decoding of MIPSxx config registers. 2005-10-29 19:31:12 +01:00
cpu.h Add support for SB1A CPU. 2005-10-29 19:32:46 +01:00
cputime.h
current.h
ddb5074.h
debug.h
delay.h Define MAX_UDELAY_MS 2005-11-07 18:05:39 +00:00
div64.h
dma-mapping.h [PATCH] gfp_t: dma-mapping (mips) 2005-10-28 08:16:48 -07:00
dma.h
ds1286.h
dsp.h Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
elf.h [PATCH] fix remaining missing includes 2005-11-07 07:53:41 -08:00
emergency-restart.h [PATCH] Add emergency_restart() 2005-07-26 14:35:41 -07:00
errno.h Delete duplicate definitions. 2005-11-07 18:05:40 +00:00
fcntl.h Complete the fcntl.h cleanup. 2005-10-29 19:32:40 +01:00
fixmap.h Delete duplicate copy of fixrange_init. 2005-10-29 19:30:28 +01:00
floppy.h
fpregdef.h [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
fpu_emulator.h Now that a struct is the only member left in struct 2005-10-29 19:31:14 +01:00
fpu.h __compute_return_epc() uses CFC1 instruction which might result in a 2005-10-29 19:31:13 +01:00
futex.h Futexes for MIPS, for the time being only the R10000_LLSC_WAR version. 2005-10-29 19:32:21 +01:00
gdb-stub.h
gfx.h
gt64120.h
gt64240.h
hardirq.h
hazards.h Fixup a few lose ends in explicit support for MIPS R1/R2. 2005-10-29 19:32:37 +01:00
highmem.h Define kmap_atomic_pfn() for MIPS. 2005-10-29 19:31:42 +01:00
hw_irq.h
i8259.h
ide.h
inst.h Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
interrupt.h Fixup a few lose ends in explicit support for MIPS R1/R2. 2005-10-29 19:32:37 +01:00
inventory.h Reformatting, remove debugging code. 2005-10-29 19:30:57 +01:00
io.h [MIPS] Add const qualifier to writes##bwlq. 2005-11-17 16:23:49 +00:00
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq_cpu.h
irq.h Sparseify MIPS. 2005-10-29 19:30:50 +01:00
isadep.h
it8712.h
jazz.h
jazzdma.h
kmap_types.h
linkage.h
local.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
m48t35.h
m48t37.h
marvell.h
mc146818-time.h Use rtc_lock to protect RTC operations 2005-11-07 18:05:38 +00:00
mc146818rtc.h
mipsmtregs.h Virtual SMP support for the 34K. 2005-10-29 19:32:10 +01:00
mipsprom.h
mipsregs.h Virtual SMP support for the 34K. 2005-10-29 19:32:10 +01: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 Fix 64bit SMP TLB handler and stack frame handling, optimize 32bit SMP 2005-10-29 19:31:00 +01:00
mmu.h
mmzone.h More configcheck fixes. 2005-10-29 19:32:40 +01:00
module.h Add spaces to MODULE_PROC_FAMILY values. 2005-11-07 18:05:34 +00:00
msc01_ic.h
msgbuf.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
namei.h
nile4.h
numnodes.h
paccess.h Gcc 4.0 fixes. 2005-10-29 19:30:53 +01:00
page.h Fixup a few lose ends in explicit support for MIPS R1/R2. 2005-10-29 19:32:37 +01:00
param.h
parport.h
pci.h BCM1480 HT support 2005-10-29 19:32:49 +01:00
percpu.h
pgalloc.h Update MIPS to use the 4-level pagetable code thereby getting rid of 2005-10-29 19:30:31 +01:00
pgtable-32.h On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but 2005-10-29 19:32:09 +01:00
pgtable-64.h [PATCH] vm: remove unused/broken page_pte[_prot] macros 2005-10-30 17:37:22 -08:00
pgtable-bits.h Rename CONFIG_CPU_MIPS{32,64} to CONFIG_CPU_MIPS{32|64}_R1. 2005-10-29 19:31:37 +01:00
pgtable.h [PATCH] fix remaining missing includes 2005-11-07 07:53:41 -08:00
pmon.h
poll.h
posix_types.h
prctl.h
prefetch.h
processor.h Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
ptrace.h Revise MIPS 64-bit ptrace interface 2005-10-29 19:32:29 +01:00
qemu.h [PATCH] mips: add support for Qemu system architecture 2005-09-05 00:06:04 -07:00
r4kcache.h More .set push/pop encapsulation, more eyefriendly code formatting. 2005-10-29 19:32:14 +01:00
reboot.h
reg.h [PATCH] mips: fix build warnings 2005-09-05 00:06:08 -07:00
regdef.h
resource.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
riscos-syscall.h
rtc.h Remove mips_rtc_lock 2005-11-07 18:05:38 +00:00
rtlx.h Turn rtlx upside down. 2005-11-07 18:05:33 +00:00
scatterlist.h
sections.h
segment.h
semaphore.h [PATCH] semaphore: Remove __MUTEX_INITIALIZER() 2005-10-30 17:37:27 -08:00
sembuf.h
serial.h Use new txx9 serial driver. 2005-10-29 19:30:52 +01:00
setup.h
sgialib.h
sgiarcs.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
sgidefs.h
shmbuf.h
shmparam.h
sigcontext.h Support the MIPS32 / MIPS64 DSP ASE. 2005-10-29 19:31:17 +01:00
siginfo.h On MIPS the struct sigev preamble is only 8 bytes. 2005-10-29 19:31:15 +01:00
signal.h [MIPS] Delete duplicate definitions of break codes. 2005-11-17 16:23:38 +00:00
sim.h kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
smp.h
sni.h
socket.h Add SOCK_DCCP definition for MIPS also. 2005-10-29 19:32:26 +01:00
sockios.h
spinlock_types.h [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
spinlock.h More configcheck fixes. 2005-10-29 19:32:40 +01:00
stackframe.h Fix get_saved_sp for 64bit address space. Simplify set_save_sp. 2005-10-29 19:31:39 +01:00
stat.h
statfs.h [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
string.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
suspend.h
sysmips.h
system.h Don't print file name and line in die and die_if_kernel. 2005-10-29 19:32:42 +01:00
termbits.h
termios.h
thread_info.h NPTL, round one. 2005-10-29 19:31:06 +01:00
time.h Use rtc_lock to protect RTC operations 2005-11-07 18:05:38 +00:00
timex.h
titan_dep.h [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
tlb.h
tlbdebug.h
tlbflush.h
topology.h
traps.h More AP / SP bits for the 34K, the Malta bits and things. Still wants 2005-10-29 19:31:53 +01:00
tx3912.h
types.h [PATCH] mips: clean up 32/64-bit configuration 2005-09-05 00:06:06 -07:00
uaccess.h Drop might_sleep() calls from get_user() & co. This should fix the issue 2005-10-29 19:32:10 +01:00
ucontext.h
unaligned.h
unistd.h [PATCH] unify sys_ptrace prototype 2005-10-30 17:37:20 -08:00
user.h
vga.h Fix endianess bugs. 2005-10-29 19:31:41 +01:00
war.h Redo RM9000 workaround which along with other DSP ASE changes was 2005-10-29 19:31:23 +01:00
watch.h
wbflush.h
xor.h
xxs1500.h [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00