linux/fs
Stephen Wilson 5b52fc890b proc: allocate storage for numa_maps statistics once
In show_numa_map() we collect statistics into a numa_maps structure.
Since the number of NUMA nodes can be very large, this structure is not a
candidate for stack allocation.

Instead of going thru a kmalloc()+kfree() cycle each time show_numa_map()
is invoked, perform the allocation just once when /proc/pid/numa_maps is
opened.

Performing the allocation when numa_maps is opened, and thus before a
reference to the target tasks mm is taken, eliminates a potential
stalemate condition in the oom-killer as originally described by Hugh
Dickins:

  ... imagine what happens if the system is out of memory, and the mm
  we're looking at is selected for killing by the OOM killer: while
  we wait in __get_free_page for more memory, no memory is freed
  from the selected mm because it cannot reach exit_mmap while we hold
  that reference.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25 08:39:35 -07:00
..
9p fs/9p: Fix error reported by coccicheck 2011-04-15 15:26:14 -05:00
adfs Fix common misspellings 2011-03-31 11:26:23 -03:00
affs
afs Fix common misspellings 2011-03-31 11:26:23 -03:00
autofs4 Fix common misspellings 2011-03-31 11:26:23 -03:00
befs Fix common misspellings 2011-03-31 11:26:23 -03:00
bfs
btrfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
cachefiles Fix common misspellings 2011-03-31 11:26:23 -03:00
ceph ceph: do not use i_wrbuffer_ref as refcount for Fb cap 2011-05-11 10:44:48 -07:00
cifs [CIFS] Fix to problem with getattr caused by invalidate simplification patch 2011-05-20 17:00:01 +00:00
coda codafs: fix build break when CONFIG_PROC_SYSCTL=n 2011-03-25 17:45:16 -07:00
configfs configfs: Fix race between configfs_readdir() and configfs_d_iput() 2011-05-18 04:08:16 -07:00
cramfs
debugfs debugfs: move to new strtobool 2011-05-19 16:55:28 +09:30
devpts
dlm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm 2011-05-24 15:04:00 -07:00
ecryptfs eCryptfs: Flush dirty pages in setattr 2011-04-25 18:49:46 -05:00
efs
exofs Fix common misspellings 2011-03-31 11:26:23 -03:00
exportfs
ext2 ext2: fix error msg when mounting fs with too-large blocksize 2011-05-17 13:47:42 +02:00
ext3 ext3: Fix fs corruption when make_indexed_dir() fails 2011-05-17 13:47:15 +02:00
ext4 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 2011-04-11 15:45:47 -07:00
fat fat: Fix statfs->f_namelen 2011-04-12 21:12:50 +09:00
freevxfs treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
fscache
fuse fuse: fix oops in revalidate when called with NULL nameidata 2011-05-10 17:35:58 +02:00
gfs2 vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
hfs
hfsplus
hostfs
hpfs HPFS: Remove unused variable 2011-05-09 09:04:24 -07:00
hppfs
hugetlbfs mm: Convert i_mmap_lock to a mutex 2011-05-25 08:39:18 -07:00
isofs
jbd jbd: Fix comment to match the code in journal_start() 2011-05-24 00:27:53 +02:00
jbd2 jbd/jbd2: remove obsolete summarise_journal_usage. 2011-05-17 13:47:42 +02:00
jffs2 Fix common misspellings 2011-03-31 11:26:23 -03:00
jfs Fix common misspellings 2011-03-31 11:26:23 -03:00
lockd
logfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
minix
ncpfs Fix common misspellings 2011-03-31 11:26:23 -03:00
nfs vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
nfs_common Fix common misspellings 2011-03-31 11:26:23 -03:00
nfsd treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
nilfs2 nilfs2: use mark_buffer_dirty to mark btnode or meta data dirty 2011-05-10 22:21:57 +09:00
nls
notify Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
ntfs Fix common misspellings 2011-03-31 11:26:23 -03:00
ocfs2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
omfs
openpromfs
partitions Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
proc proc: allocate storage for numa_maps statistics once 2011-05-25 08:39:35 -07:00
pstore pstore: fix pstore filesystem mount/remount issue 2011-05-16 11:05:00 -07:00
qnx4
quota vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
ramfs ramfs: fix memleak on no-mmu arch 2011-04-14 16:06:56 -07:00
reiserfs Fix common misspellings 2011-03-31 11:26:23 -03:00
romfs
squashfs treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
sysfs sysfs: remove "last sysfs file:" line from the oops messages 2011-05-13 16:05:51 -07:00
sysv
ubifs UBIFS: switch to dynamic printks 2011-05-23 08:22:20 +03:00
udf
ufs Merge branch 'master' into for-next 2011-04-26 10:22:59 +02:00
xfs vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
aio.c
anon_inodes.c
attr.c Fix common misspellings 2011-03-31 11:26:23 -03:00
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c brk: COMPAT_BRK: fix detection of randomized brk 2011-04-14 16:06:55 -07:00
binfmt_em86.c
binfmt_flat.c CRED: Fix load_flat_shared_library() to initialise bprm correctly 2011-05-03 10:10:51 +10:00
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c Fix common misspellings 2011-03-31 11:26:23 -03:00
block_dev.c block: move bd_set_size() above rescan_partitions() in __blkdev_get() 2011-05-23 08:50:48 -07:00
buffer.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2011-03-24 19:01:30 -07:00
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c exec: unify do_execve/compat_do_execve code 2011-04-09 15:53:56 +02:00
dcache.c vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
dcookies.c
direct-io.c
drop_caches.c vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
eventfd.c
eventpoll.c Fix common misspellings 2011-03-31 11:26:23 -03:00
exec.c mm: mmu_gather rework 2011-05-25 08:39:12 -07:00
fcntl.c
fhandle.c fs/fhandle.c: add <linux/personality.h> for ia64 2011-04-14 16:06:56 -07:00
fifo.c
file_table.c
file.c vfs: avoid large kmalloc()s for the fdtable 2011-04-28 11:28:20 -07:00
filesystems.c fs: synchronize_rcu when unregister_filesystem success not failure 2011-04-17 10:42:01 -07:00
fs_struct.c
fs-writeback.c Fix common misspellings 2011-03-31 11:26:23 -03:00
generic_acl.c
inode.c vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
internal.h fs: move i_wb_list out from under inode_lock 2011-03-24 21:17:51 -04:00
ioctl.c
ioprio.c
Kconfig tmpfs: implement generic xattr support 2011-05-25 08:39:31 -07:00
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
mpage.c
namei.c VFS: move BUG_ON test for symlink nd->depth after current->link_count test 2011-05-21 00:12:16 -07:00
namespace.c Revert "vfs: Export file system uuid via /proc/<pid>/mountinfo" 2011-04-12 13:35:56 -07:00
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c VFS: trivial: fix comment on s_maxbytes value warning check 2011-05-19 14:10:49 +00:00
sync.c
timerfd.c timerfd: Manage cancelable timers in timerfd 2011-05-23 13:59:53 +02:00
utimes.c
xattr_acl.c
xattr.c vfs: Pass setxattr(2) flags properly 2011-04-21 07:34:44 -07:00