Many embedded devices use zram as swap. Compared to storage swap
(e.g. UFS), swapin from zram(ie., decompression) is extremly fast
so it might be not major fault but minor. So this patch provides
swapin latency tracking to distinguish them from storage major
fault.
Mot-CRs-fixed: (CR)
Bug:
80168800
Change-Id: I1c32430e32a051916ede5219bd5f40a9002652bc
Signed-off-by: Minchan Kim <minchan@google.com>
Reviewed-on: https://gerrit.mot.com/
1453723
Tested-by: Jira Key
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
tsk->maj_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs,
addr);
- mm_event_end(MM_MAJ_FAULT, event_ts);
+ if (fault & VM_FAULT_SWAP)
+ mm_event_end(MM_SWP_FAULT, event_ts);
+ else
+ mm_event_end(MM_MAJ_FAULT, event_ts);
} else {
tsk->min_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs,
#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned small page */
#define VM_FAULT_HWPOISON_LARGE 0x0020 /* Hit poisoned large page. Index encoded in upper bits */
#define VM_FAULT_SIGSEGV 0x0040
+#define VM_FAULT_SWAP 0x0080
#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
MM_MAJ_FAULT,
MM_COMPACTION,
MM_RECLAIM,
+ MM_SWP_FAULT,
MM_TYPE_NUM,
};
{ MM_MIN_FAULT, "min_flt" }, \
{ MM_MAJ_FAULT, "maj_flt" }, \
{ MM_COMPACTION, "compaction" }, \
- { MM_RECLAIM, "reclaim" })
+ { MM_RECLAIM, "reclaim" }, \
+ { MM_SWP_FAULT, "swp_flt" })
TRACE_EVENT(mm_event_record,
unlock:
pte_unmap_unlock(vmf->pte, vmf->ptl);
out:
- return ret;
+ return ret | VM_FAULT_SWAP;
out_nomap:
mem_cgroup_cancel_charge(page, memcg, false);
pte_unmap_unlock(vmf->pte, vmf->ptl);
unlock_page(swapcache);
put_page(swapcache);
}
- return ret;
+ return ret | VM_FAULT_SWAP;
}
/*