mm: synchronize period update interval
authorMinchan Kim <minchan@google.com>
Thu, 17 Jan 2019 02:14:14 +0000 (11:14 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:24:01 +0000 (20:24 +0300)
commit1fa167b23d65cdb84b678f0b31b2a22efef03035
treeaf60b6c405c768ea40cb2d30b95e477caba6c7eb
parent4c342942efb8e1fc5a23404d739941ace888fce6
mm: synchronize period update interval

Wei pointed out period update is racy so it could make partial
update, which could lose a ton of trace potentially.

To close period_ms race between updating and reading, use rwlock
to reduce contention.
To close vmstat_period_ms between updating and reading,
use vmstat_lock.

This patch has small refactoring, too.

Mot-CRs-fixed: (CR)

Bug: 80168800
Change-Id: I7f84cff758b533b7881f47889c7662b743bc3c12
Signed-off-by: Minchan Kim <minchan@google.com>
Reviewed-on: https://gerrit.mot.com/1453729
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
mm/mm_event.c