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
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,
https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes
better to remove the lock and convert variables to atomic, with preventing
poteintial store-to-read tearing as a bonus.
Signed-off-by: Arun KS <email@example.com>
Suggested-by: Michal Hocko <firstname.lastname@example.org>
Suggested-by: Vlastimil Babka <email@example.com>
Reviewed-by: Konstantin Khlebnikov <firstname.lastname@example.org>
Reviewed-by: David Hildenbrand <email@example.com>
Acked-by: Michal Hocko <firstname.lastname@example.org>
Acked-by: Vlastimil Babka <email@example.com>
Reviewed-by: Pavel Tatashin <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>