]> git.baikalelectronics.ru Git - kernel.git/commit
shmem: update memory reservation on truncate
authorKonstantin Khlebnikov <koct9i@gmail.com>
Wed, 6 Aug 2014 23:06:34 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:19 +0000 (18:01 -0700)
commit75e6ae1c6a4b52a1bcb1b363425eb2b92b6de58a
tree9ad927b6f48ad2e6a89830ae4f3ee3fa99976646
parent4c228dfd499605a47736d527bce4f3fc0da1ddd6
shmem: update memory reservation on truncate

A shared anonymous mapping created without MAP_NORESERVE holds memory
reservation for whole range of shmem segment.  Usually there is no way
to change its size, but /proc/<pid>/map_files/...  (available if
CONFIG_CHECKPOINT_RESTORE=y) allows that.

This patch adjusts the memory reservation in shmem_setattr().

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c