diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index dce2d7e95005..edd1dbe3ac34 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -113,6 +113,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_send_tm_command); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_check_int_errors); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_update_sdev); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_f2fs_down_read); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_improve_priority); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_f2fs_restore_priority); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_io_statistics); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops); diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 6b3113958f6b..2a241d039a5e 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1903,10 +1903,18 @@ int f2fs_issue_checkpoint(struct f2fs_sb_info *sbi) if (waitqueue_active(&cprc->ckpt_wait_queue)) wake_up(&cprc->ckpt_wait_queue); - if (cprc->f2fs_issue_ckpt) + if (cprc->f2fs_issue_ckpt) { + bool prio_changed = false; + int saved_prio; + + trace_android_vh_f2fs_improve_priority(cprc->f2fs_issue_ckpt, &saved_prio, + &prio_changed); wait_for_completion(&req.wait); - else + if (prio_changed) + trace_android_vh_f2fs_restore_priority(cprc->f2fs_issue_ckpt, saved_prio); + } else { flush_remained_ckpt_reqs(sbi, &req); + } return req.ret; } diff --git a/include/trace/hooks/fs.h b/include/trace/hooks/fs.h index 93132d98c846..eff712e6a503 100644 --- a/include/trace/hooks/fs.h +++ b/include/trace/hooks/fs.h @@ -13,6 +13,14 @@ DECLARE_RESTRICTED_HOOK(android_rvh_f2fs_down_read, TP_PROTO(wait_queue_head_t *read_waiters, struct rw_semaphore *rwsem, bool *skip), TP_ARGS(read_waiters, rwsem, skip), 1); +DECLARE_HOOK(android_vh_f2fs_improve_priority, + TP_PROTO(struct task_struct *p, int *saved_prio, bool *skip), + TP_ARGS(p, saved_prio, skip)); + +DECLARE_HOOK(android_vh_f2fs_restore_priority, + TP_PROTO(struct task_struct *p, int saved_prio), + TP_ARGS(p, saved_prio)); + #endif /* _TRACE_HOOK_FS_H */ /* This part must be outside protection */