path: root/mm/zswap.c
diff options
authorArun KS <>2018-12-28 00:34:24 -0800
committerLinus Torvalds <>2018-12-28 12:11:47 -0800
commit9705bea5f833f4fc21d5bef5fce7348427f76ea4 (patch)
tree37604aa5b680736eb176283f970e1c1d7d27bbf3 /mm/zswap.c
parent3d6357de8aa09e1966770dc1171c72679946464f (diff)
mm: convert zone->managed_pages to atomic variable
totalram_pages, zone->managed_pages and totalhigh_pages updates are protected by managed_page_count_lock, but readers never care about it. Convert these variables to atomic to avoid readers potentially seeing a store tear. This patch converts zone->managed_pages. Subsequent patches will convert totalram_panges, totalhigh_pages and eventually managed_page_count_lock will be removed. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, So it seemes better to remove the lock and convert variables to atomic, with preventing poteintial store-to-read tearing as a bonus. Link: Signed-off-by: Arun KS <> Suggested-by: Michal Hocko <> Suggested-by: Vlastimil Babka <> Reviewed-by: Konstantin Khlebnikov <> Reviewed-by: David Hildenbrand <> Acked-by: Michal Hocko <> Acked-by: Vlastimil Babka <> Reviewed-by: Pavel Tatashin <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/zswap.c')
0 files changed, 0 insertions, 0 deletions