android_kernel_samsung_msm8226/mm
David Herrmann 610866cae2 shm: add memfd_create() syscall
memfd_create() is similar to mmap(MAP_ANON), but returns a file-descriptor
that you can pass to mmap().  It can support sealing and avoids any
connection to user-visible mount-points.  Thus, it's not subject to quotas
on mounted file-systems, but can be used like malloc()'ed memory, but with
a file-descriptor to it.

memfd_create() returns the raw shmem file, so calls like ftruncate() can
be used to modify the underlying inode.  Also calls like fstat() will
return proper information and mark the file as regular file.  If you want
sealing, you can specify MFD_ALLOW_SEALING.  Otherwise, sealing is not
supported (like on all other regular files).

Compared to O_TMPFILE, it does not require a tmpfs mount-point and is not
subject to a filesystem size limit.  It is still properly accounted to
memcg limits, though, and to the same overcommit or no-overcommit
accounting as all user memory.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Ryan Lortie <desrt@desrt.ca>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-01-06 08:48:36 +01:00
..
Kconfig mm: Backport ZRAM/ZSMALLOC from Google kernel 2019-08-06 08:17:38 +02:00
Kconfig.debug mm: more intensive memory corruption debugging 2012-01-10 16:30:42 -08:00
Makefile misc: fix some GCC warnings 2020-01-06 08:40:46 +01:00
backing-dev.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
bootmem.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
bounce.c mm: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:27 +08:00
cleancache.c mm: cleancache: Use __read_mostly as appropiate. 2012-01-23 16:08:09 -05:00
compaction.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
debug-pagealloc.c mm: Mark free pages as read only 2014-04-22 10:32:19 -07:00
dmapool.c mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls 2013-04-10 18:03:01 -07:00
fadvise.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
failslab.c switch debugfs to umode_t 2012-01-03 22:54:56 -05:00
filemap.c fs: introduce inode operation ->update_time 2019-08-06 10:44:13 +02:00
filemap_xip.c fs: introduce inode operation ->update_time 2019-08-06 10:44:13 +02:00
fremap.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
frontswap.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
highmem.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
huge_memory.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
hugetlb.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
hwpoison-inject.c HWPOISON: Clean up memory_failure() vs. __memory_failure() 2012-01-03 12:06:32 -08:00
init-mm.c
internal.h Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
kmemcheck.c
kmemleak-test.c
kmemleak.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
ksm.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
maccess.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
madvise.c mm: add a field to store names for private anonymous memory 2014-11-05 11:32:48 +05:30
memblock.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
memcontrol.c Merge remote-tracking branch 'google-common/deprecated/android-3.4' into lineage-16.0 2019-08-06 11:41:21 +02:00
memory-failure.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
memory.c mm: introduce vma_is_anonymous(vma) helper 2020-01-06 08:40:44 +01:00
memory_hotplug.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
mempolicy.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
mempool.c mempool: fix first round failure behavior 2012-01-10 16:30:45 -08:00
migrate.c mm: migrate dirty page without clear_page_dirty_for_io etc 2019-08-06 12:19:38 +02:00
mincore.c mm/mincore.c: make mincore() more conservative 2020-01-06 08:40:44 +01:00
mlock.c Merge remote-tracking branch 'google-common/deprecated/android-3.4' into lineage-16.0 2019-08-06 11:41:21 +02:00
mm_init.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
mmap.c Allow stack to grow up to address space limit 2019-08-06 12:26:29 +02:00
mmu_context.c mm, counters: remove task argument to sync_mm_rss() and __sync_task_rss_stat() 2012-03-21 17:54:59 -07:00
mmu_notifier.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
mmzone.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
mprotect.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
mremap.c mm: collapse security_vm_enough_memory() variants into a single function 2012-02-14 10:45:39 +11:00
msync.c
nobootmem.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
nommu.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
oom_kill.c mm, oom: make dump_tasks public 2019-08-08 12:09:23 +02:00
page-writeback.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
page_alloc.c Merge remote-tracking branch 'google-common/deprecated/android-3.4' into lineage-16.0 2019-08-06 11:41:21 +02:00
page_cgroup.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
page_io.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
page_isolation.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
pagewalk.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
percpu-km.c
percpu-vm.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
percpu.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
pgtable-generic.c thp: add HPAGE_PMD_* definitions for !CONFIG_TRANSPARENT_HUGEPAGE 2012-03-21 17:55:02 -07:00
prio_tree.c
process_vm_access.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
quicklist.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
readahead.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
rmap.c misc: fix some GCC warnings 2020-01-06 08:40:46 +01:00
shmem.c shm: add memfd_create() syscall 2020-01-06 08:48:36 +01:00
showmem.c mm: Add notifier framework for showing memory 2019-08-08 12:09:25 +02:00
slab.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
slob.c mm: Map most files to use export.h instead of module.h 2011-10-31 09:20:12 -04:00
slub.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
sparse-vmemmap.c mm: delete various needless include <linux/module.h> 2011-10-31 09:20:11 -04:00
sparse.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
swap.c swap: make each swap partition have one address_space 2019-08-06 08:17:37 +02:00
swap_state.c lowmemorykiller: Don't count swap cache pages twice 2019-08-08 12:09:23 +02:00
swapfile.c swap: make each swap partition have one address_space 2019-08-06 08:17:37 +02:00
truncate.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
util.c swap: make each swap partition have one address_space 2019-08-06 08:17:37 +02:00
vmalloc.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
vmpressure.c mm: vmpressure: fix backport 2019-08-08 12:26:41 +02:00
vmscan.c mm: only force scan in reclaim when none of the LRUs are big enough. 2020-01-06 08:40:45 +01:00
vmstat.c lowmemorykiller: Don't count swap cache pages twice 2019-08-08 12:09:23 +02:00
zbud.c mm: Backport ZCache from QC kernel 3.18 2019-08-06 08:16:29 +02:00
zcache.c zcache: Remove WARN_ON 2019-08-06 08:17:38 +02:00
zsmalloc.c mm: Backport ZRAM/ZSMALLOC from Google kernel 2019-08-06 08:17:38 +02:00
zswap.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00