]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix rss count leakage during migration
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Fri, 20 Jan 2012 22:34:24 +0000 (14:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Jan 2012 16:38:49 +0000 (08:38 -0800)
commitabec2ab5c753c069c2fda279b0435d3922b5d6a5
treecfa1485d01cb36c720f1e2b96b21748acc10ec06
parent489fc0708e8a997d8adf88e07dc741a82b4f5a23
mm: fix rss count leakage during migration

Memory migration fills a pte with a migration entry and it doesn't
update the rss counters.  Then it replaces the migration entry with the
new page (or the old one if migration failed).  But between these two
passes this pte can be unmaped, or a task can fork a child and it will
get a copy of this migration entry.  Nobody accounts for this in the rss
counters.

This patch properly adjust rss counters for migration entries in
zap_pte_range() and copy_one_pte().  Thus we avoid extra atomic
operations on the migration fast-path.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c