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)
commit87bba3c932721dd8cfdb629c9ebc8d171acc35f1
treead4350735b2c2ec72ac3452d168f366f76915284
parentb0859fb60d1424e279d7306dbcb03e222474ac59
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