Skip to content

Commit 1eb17f5

Browse files
jankaraaxboe
authored andcommitted
bfq: Log waker detections
Waker - wakee relationships are important in deciding whether one queue can preempt the other one. Print information about detected waker-wakee relationships so that scheduling decisions can be better understood from block traces. Acked-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20211125133645.27483-7-jack@suse.cz Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 582f04e commit 1eb17f5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎block/bfq-iosched.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,6 +2127,8 @@ static void bfq_update_io_intensity(struct bfq_queue *bfqq, u64 now_ns)
21272127
static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq,
21282128
u64 now_ns)
21292129
{
2130+
char waker_name[MAX_BFQQ_NAME_LENGTH];
2131+
21302132
if (!bfqd->last_completed_rq_bfqq ||
21312133
bfqd->last_completed_rq_bfqq == bfqq ||
21322134
bfq_bfqq_has_short_ttime(bfqq) ||
@@ -2154,12 +2156,18 @@ static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq,
21542156
bfqd->last_completed_rq_bfqq;
21552157
bfqq->num_waker_detections = 1;
21562158
bfqq->waker_detection_started = now_ns;
2159+
bfq_bfqq_name(bfqq->tentative_waker_bfqq, waker_name,
2160+
MAX_BFQQ_NAME_LENGTH);
2161+
bfq_log_bfqq(bfqd, bfqq, "set tenative waker %s", waker_name);
21572162
} else /* Same tentative waker queue detected again */
21582163
bfqq->num_waker_detections++;
21592164

21602165
if (bfqq->num_waker_detections == 3) {
21612166
bfqq->waker_bfqq = bfqd->last_completed_rq_bfqq;
21622167
bfqq->tentative_waker_bfqq = NULL;
2168+
bfq_bfqq_name(bfqq->waker_bfqq, waker_name,
2169+
MAX_BFQQ_NAME_LENGTH);
2170+
bfq_log_bfqq(bfqd, bfqq, "set waker %s", waker_name);
21632171

21642172
/*
21652173
* If the waker queue disappears, then

0 commit comments

Comments
 (0)