Record the count of special page allocation on the process context.
This patch aims for accounting of special page allocation which
consumed a lot by android system.
At this moment, ION system heap is good candidate(it could cover
other kernel allocation in future).
With that, we could keep tracking burst kernel allocation owner
so that it would be useful to find places caused by lmk, reclaim,
compaction latency.
Mot-CRs-fixed: (CR)
Bug:
80168800
Change-Id: I5942fd940d98baa2eb814f66b076cb37ecd3b4aa
Signed-off-by: Minchan Kim <minchan@google.com>
Reviewed-on: https://gerrit.mot.com/
1453724
Tested-by: Jira Key
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
perrfn("failed to alloc order-0 page (gfp %pGg)", &gfpmask);
return NULL;
}
+
+ mm_event_count(MM_KERN_ALLOC, 1 << pool->order);
+
return page;
}
MM_COMPACTION,
MM_RECLAIM,
MM_SWP_FAULT,
+ MM_KERN_ALLOC,
MM_TYPE_NUM,
};
void mm_event_task_init(struct task_struct *tsk);
void mm_event_start(ktime_t *time);
void mm_event_end(enum mm_event_type event, ktime_t start);
+void mm_event_count(enum mm_event_type event, int count);
#else
static inline void mm_event_task_init(struct task_struct *tsk) {}
static inline void mm_event_start(ktime_t *time) {}
static inline void mm_event_end(enum mm_event_type event, ktime_t start) {}
+static inline void mm_event_count(enum mm_event_type event, int count) {}
#endif /* _LINUX_MM_EVENT_H */
#endif
{ MM_MAJ_FAULT, "maj_flt" }, \
{ MM_COMPACTION, "compaction" }, \
{ MM_RECLAIM, "reclaim" }, \
- { MM_SWP_FAULT, "swp_flt" })
+ { MM_SWP_FAULT, "swp_flt" }, \
+ { MM_KERN_ALLOC, "kern_alloc" })
TRACE_EVENT(mm_event_record,
record_stat();
}
+void mm_event_count(enum mm_event_type event, int count)
+{
+ current->mm_event[event].count += count;
+ record_stat();
+}
+
static struct dentry *mm_event_root;
static int period_ms_set(void *data, u64 val)