diff options
author | Johannes Weiner <[email protected]> | 2013-05-24 15:55:15 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-05-24 16:22:51 -0700 |
commit | 28ccddf7952c496df2a51ce5aee4f2a058a98bab (patch) | |
tree | 6c8b8ebc4677f2b2fab0bf61a9a4c860970c82e9 /lib/mpi/mpi-bit.c | |
parent | 26549c8d36a64d9130e4c0f32412be7ba6180923 (diff) |
mm: memcg: remove incorrect VM_BUG_ON for swap cache pages in uncharge
Commit 0c59b89c81ea ("mm: memcg: push down PageSwapCache check into
uncharge entry functions") added a VM_BUG_ON() on PageSwapCache in the
uncharge path after checking that page flag once, assuming that the
state is stable in all paths, but this is not the case and the condition
triggers in user environments. An uncharge after the last page table
reference to the page goes away can race with reclaim adding the page to
swap cache.
Swap cache pages are usually uncharged when they are freed after
swapout, from a path that also handles swap usage accounting and memcg
lifetime management. However, since the last page table reference is
gone and thus no references to the swap slot left, the swap slot will be
freed shortly when reclaim attempts to write the page to disk. The
whole swap accounting is not even necessary.
So while the race condition for which this VM_BUG_ON was added is real
and actually existed all along, there are no negative effects. Remove
the VM_BUG_ON again.
Reported-by: Heiko Carstens <[email protected]>
Reported-by: Lingzhu Xiang <[email protected]>
Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions