ANDROID: add hooks into blk-mq-sched.c for customized I/O scheduler
android_vh_blk_mq_sched_insert_request: Add judgment on rq. If it is a customized rq, it needs to be added to the corresponding customized queue Bug: 319582497 Change-Id: I2bf8fee37273b3495d60c64bb53e43debceb5614 Signed-off-by: hao lv <hao.lv5@transsion.com>
This commit is contained in:
parent
6912e0c8e9
commit
94b9d8e513
@ -422,6 +422,7 @@ static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <trace/hooks/block.h>
|
||||||
void blk_mq_sched_insert_request(struct request *rq, bool at_head,
|
void blk_mq_sched_insert_request(struct request *rq, bool at_head,
|
||||||
bool run_queue, bool async)
|
bool run_queue, bool async)
|
||||||
{
|
{
|
||||||
@ -429,10 +430,13 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head,
|
|||||||
struct elevator_queue *e = q->elevator;
|
struct elevator_queue *e = q->elevator;
|
||||||
struct blk_mq_ctx *ctx = rq->mq_ctx;
|
struct blk_mq_ctx *ctx = rq->mq_ctx;
|
||||||
struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
|
struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
|
||||||
|
bool skip = false;
|
||||||
|
|
||||||
WARN_ON(e && (rq->tag != BLK_MQ_NO_TAG));
|
WARN_ON(e && (rq->tag != BLK_MQ_NO_TAG));
|
||||||
|
|
||||||
if (blk_mq_sched_bypass_insert(hctx, !!e, rq)) {
|
trace_android_vh_blk_mq_sched_insert_request(&skip, rq);
|
||||||
|
|
||||||
|
if (!skip && blk_mq_sched_bypass_insert(hctx, !!e, rq)) {
|
||||||
/*
|
/*
|
||||||
* Firstly normal IO request is inserted to scheduler queue or
|
* Firstly normal IO request is inserted to scheduler queue or
|
||||||
* sw queue, meantime we add flush request to dispatch queue(
|
* sw queue, meantime we add flush request to dispatch queue(
|
||||||
|
@ -536,6 +536,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_flush_queue);
|
|||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_all_tag_iter);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_all_tag_iter);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_queue_tag_busy_iter);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_queue_tag_busy_iter);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_free_tags);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_free_tags);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_sched_insert_request);
|
||||||
/*
|
/*
|
||||||
* For type visibility
|
* For type visibility
|
||||||
*/
|
*/
|
||||||
|
@ -113,6 +113,10 @@ DECLARE_HOOK(android_vh_blk_alloc_flush_queue,
|
|||||||
struct blk_flush_queue *fq),
|
struct blk_flush_queue *fq),
|
||||||
TP_ARGS(skip, cmd_size, flags, node, fq));
|
TP_ARGS(skip, cmd_size, flags, node, fq));
|
||||||
|
|
||||||
|
DECLARE_HOOK(android_vh_blk_mq_sched_insert_request,
|
||||||
|
TP_PROTO(bool *skip, struct request *rq),
|
||||||
|
TP_ARGS(skip, rq));
|
||||||
|
|
||||||
#endif /* _TRACE_HOOK_BLOCK_H */
|
#endif /* _TRACE_HOOK_BLOCK_H */
|
||||||
|
|
||||||
/* This part must be outside protection */
|
/* This part must be outside protection */
|
||||||
|
Loading…
Reference in New Issue
Block a user