Linux block layer
 help / color / mirror / Atom feed
From: "李佑鸿 " <dayou5941@163.com>
To: yukuai@fygo.io
Cc: linux-block@vger.kernel.org, axboe@kernel.dk, liyouhong@kylinos.cn
Subject: Re:Re: [PATCH] block, bfq: skip dispatch when selected queue has no next_rq
Date: Thu, 21 May 2026 17:43:50 +0800 (CST)	[thread overview]
Message-ID: <3446c150.87ac.19e49eb7f3f.Coremail.dayou5941@163.com> (raw)
In-Reply-To: <f0c0ed75-0858-4464-b22f-d64a6e3048cd@fygo.io>


















At 2026-05-21 17:27:28, "Yu Kuai" <yukuai@fnnas.com> wrote:
>Hi,
>
>在 2026/5/20 17:50, dayou5941@163.com 写道:
>> From: liyouhong <liyouhong@kylinos.cn>
>>
>> bfq_dispatch_rq_from_bfqq() dispatches bfqq->next_rq directly. Add a
>> guard in __bfq_dispatch_request() so that dispatch is skipped if the
>> selected queue unexpectedly has no next request.
>>
>> This keeps behavior unchanged in normal paths while avoiding entering
>> the dispatch helper with a missing next_rq.
>
>Can you explan in which case bfqq can be returned from bfq_select_queue
>with next_rq set to NULL? I didn't find it with a quick review.
>
>Take a look at bfq_dispatch_rq_from_bfqq(), bfqq->next_rq will be dereferenced
>unconditionally, which should lead to kernel crash before this patch if
>next_rq can be NULL.

>

Thanks for the clarification.

I agree there is no demonstrated path for `next_rq == NULL` here, so I'll drop
this patch.

One follow-up question: if `next_rq` is guaranteed non-NULL after
`bfq_select_queue()`, would you consider the `if (rq)` check after
`bfq_dispatch_rq_from_bfqq()` redundant for that path?

Thanks,
liyouhong

      reply	other threads:[~2026-05-21  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  9:50 [PATCH] block, bfq: skip dispatch when selected queue has no next_rq dayou5941
2026-05-21  9:27 ` Yu Kuai
2026-05-21  9:43   ` 李佑鸿  [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3446c150.87ac.19e49eb7f3f.Coremail.dayou5941@163.com \
    --to=dayou5941@163.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=liyouhong@kylinos.cn \
    --cc=yukuai@fygo.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox