]> git.baikalelectronics.ru Git - kernel.git/commit
mmap: fix and tidy up overcommit page arithmetic
authorDmitry Fink <dmitry.fink@palm.com>
Tue, 26 Jul 2011 00:12:19 +0000 (17:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 03:57:09 +0000 (20:57 -0700)
commit8dc123a6d2b1888b94151cd09c9aca34e10b657b
treeec09c0b25eae42d6693a08decde7aee02f296978
parent9cbe9b96681aaca3b178209b81a0435f363eeadb
mmap: fix and tidy up overcommit page arithmetic

- shmem pages are not immediately available, but they are not
  potentially available either, even if we swap them out, they will just
  relocate from memory into swap, total amount of immediate and
  potentially available memory is not going to be affected, so we
  shouldn't count them as potentially free in the first place.

- nr_free_pages() is not an expensive operation anymore, there is no
  need to split the decision making in two halves and repeat code.

Signed-off-by: Dmitry Fink <dmitry.fink@palm.com>
Reviewed-by: Minchan Kim <minchan.kim@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/mmap.c
mm/nommu.c