aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/netdev-times.py
diff options
context:
space:
mode:
authorWeijie Yang <[email protected]>2013-11-12 15:08:26 -0800
committerLinus Torvalds <[email protected]>2013-11-13 12:09:10 +0900
commit67d13fe846c57a54d12578e7a4518f68c5c86ad7 (patch)
treeb1b00b15b87941b26f05bb181150c5d1fffbccc0 /tools/perf/scripts/python/netdev-times.py
parent7a67d7abcc8da30a16ed64c3909d3fea004bde93 (diff)
mm/zswap: bugfix: memory leak when invalidate and reclaim occur concurrently
Consider the following scenario: thread 0: reclaim entry x (get refcount, but not call zswap_get_swap_cache_page) thread 1: call zswap_frontswap_invalidate_page to invalidate entry x. finished, entry x and its zbud is not freed as its refcount != 0 now, the swap_map[x] = 0 thread 0: now call zswap_get_swap_cache_page swapcache_prepare return -ENOENT because entry x is not used any more zswap_get_swap_cache_page return ZSWAP_SWAPCACHE_NOMEM zswap_writeback_entry do nothing except put refcount Now, the memory of zswap_entry x and its zpage leak. Modify: - check the refcount in fail path, free memory if it is not referenced. - use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path can be not only caused by nomem but also by invalidate. Signed-off-by: Weijie Yang <[email protected]> Reviewed-by: Bob Liu <[email protected]> Reviewed-by: Minchan Kim <[email protected]> Acked-by: Seth Jennings <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions