android_kernel_xiaomi_sm7250/mm
Eric W. Biederman 99f8955183 [PATCH] proc: don't lock task_structs indefinitely
Every inode in /proc holds a reference to a struct task_struct.  If a
directory or file is opened and remains open after the the task exits this
pinning continues.  With 8K stacks on a 32bit machine the amount pinned per
file descriptor is about 10K.

Normally I would figure a reasonable per user process limit is about 100
processes.  With 80 processes, with a 1000 file descriptors each I can trigger
the 00M killer on a 32bit kernel, because I have pinned about 800MB of useless
data.

This patch replaces the struct task_struct pointer with a pointer to a struct
task_ref which has a struct task_struct pointer.  The so the pinning of dead
tasks does not happen.

The code now has to contend with the fact that the task may now exit at any
time.  Which is a little but not muh more complicated.

With this change it takes about 1000 processes each opening up 1000 file
descriptors before I can trigger the OOM killer.  Much better.

[mlp@google.com: task_mmu small fixes]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Paul Jackson <pj@sgi.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Albert Cahalan <acahalan@gmail.com>
Signed-off-by: Prasanna Meda <mlp@google.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-26 09:58:25 -07:00
..
bootmem.c
fadvise.c
filemap_xip.c
filemap.c [PATCH] readahead: backoff on I/O error 2006-06-25 10:01:17 -07:00
filemap.h [PATCH] Prepare for __copy_from_user_inatomic to not zero missed bytes 2006-06-25 10:01:09 -07:00
fremap.c
highmem.c
hugetlb.c
internal.h
Kconfig
madvise.c
Makefile
memory_hotplug.c [PATCH] update vm_total_pages at memory hotadd 2006-06-23 07:42:52 -07:00
memory.c
mempolicy.c [PATCH] proc: don't lock task_structs indefinitely 2006-06-26 09:58:25 -07:00
mempool.c
migrate.c [PATCH] Allow migration of mlocked pages 2006-06-25 10:00:55 -07:00
mincore.c
mlock.c
mmap.c
mmzone.c
mprotect.c
mremap.c
msync.c [PATCH] Kill PF_SYNCWRITE flag 2006-06-23 17:10:39 +02:00
nommu.c
oom_kill.c
page_alloc.c [PATCH] cpuset: remove extra cpuset_zone_allowed check in __alloc_pages 2006-06-25 10:01:08 -07:00
page_io.c
page-writeback.c
pdflush.c [PATCH] pdflush: handle resume wakeups 2006-06-25 10:01:06 -07:00
prio_tree.c
readahead.c [PATCH] kernel-doc: mm/readhead fixup 2006-06-25 10:01:10 -07:00
rmap.c [PATCH] Allow migration of mlocked pages 2006-06-25 10:00:55 -07:00
shmem.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2006-06-24 13:07:53 -04:00
slab.c [PATCH] slab: kmalloc, kzalloc comments cleanup and fix 2006-06-23 07:42:52 -07:00
slob.c
sparse.c
swap_state.c
swap.c [PATCH] core: use list_move() 2006-06-26 09:58:17 -07:00
swapfile.c [PATCH] read_mapping_page for address space 2006-06-23 07:43:02 -07:00
thrash.c
tiny-shmem.c
truncate.c [PATCH] Remove semi-softlockup from invalidate_mapping_pages 2006-06-23 07:43:07 -07:00
util.c
vmalloc.c
vmscan.c