mm: synchronize period update interval
authorMinchan Kim <minchan@google.com>
Thu, 17 Jan 2019 02:14:14 +0000 (11:14 +0900)
committerPDO SCM Team <hudsoncm@motorola.com>
Fri, 15 Nov 2019 06:58:52 +0000 (00:58 -0600)
commit1a06e1f6df241b0f5872991b58f7eeae979474a7
treead4350735b2c2ec72ac3452d168f366f76915284
parentd56593f27939d9841d43d91f584e601a16124d4d
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