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>
Mon, 2 Sep 2024 03:25:51 +0000 (20:25 -0700)
commit57979fabff554bf4d1edeeee69251b22ca9bf55e
tree8a46efc7e788296316151d1142fde163471ae750
parent941ce635234162c420c9185816c59f7d5dd1ad07
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