]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro
authorRoman Gushchin <roman.gushchin@linux.dev>
Fri, 26 Jul 2024 20:31:10 +0000 (20:31 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:36 +0000 (17:52 -0700)
commit760fc83016199e43cbeb2f3f0d1ea9b67e23d16b
tree02fd3807a5367cc700b140023a53596bd88ccfac
parent840f30c014ea3599ab9f1b529e638a2869cc1c7e
mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro

When a page_counter structure is initialized, there is no need to use an
atomic set operation to initialize the usage counter because at this point
the structure is not visible to anybody else.  ATOMIC_LONG_INIT() is what
should be used in such cases.

Link: https://lkml.kernel.org/r/20240726203110.1577216-4-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page_counter.h