linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Mike Snitzer <snitzer@redhat.com>
Subject: Re: [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy
Date: Thu, 08 Nov 2018 10:54:43 -0500	[thread overview]
Message-ID: <1541692483.24444.3.camel@redhat.com> (raw)
In-Reply-To: <20181108154216.23853-3-axboe@kernel.dk>

On Thu, 2018-11-08 at 08:42 -0700, Jens Axboe wrote:
> +static bool blk_mq_check_busy(struct blk_mq_hw_ctx *hctx, struct
> request *rq,
> +                             void *priv, bool reserved)
> +{
> +       bool *busy = (bool *) priv;
> +
> +       /*
> +        * If we find a request, we know the queue is busy. Return
> false
> +        * to stop the iteration.
> +        */
> +       *busy = true;
> +       return false;
> +}
> +

Hi Jens,

Trying to understand the logic, likely just my lack of knowledge
You return false after setting true because you say we know the queue
is busy.
How do we know we found a request here
I dont see you check the result of 
 bool *busy = (bool *) priv;
Is the assumption here because this was called we already knew we had a
request

Apologies it its just my lack of understanding

+static bool blk_mq_check_busy(struct blk_mq_hw_ctx *hctx, struct
request *rq,
+                             void *priv, bool reserved)
+{
+       bool *busy = (bool *) priv;
+
+       /*
+        * If we find a request, we know the queue is busy. Return
false
+        * to stop the iteration.
+        */
+       *busy = true;
+       return false;
+}
+

  parent reply	other threads:[~2018-11-08 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 15:42 [PATCHSET 0/2] Add queue_is_busy helper Jens Axboe
2018-11-08 15:42 ` [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not Jens Axboe
2018-11-08 15:48   ` Mike Snitzer
2018-11-08 15:42 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
2018-11-08 15:49   ` Mike Snitzer
2018-11-08 15:54   ` Laurence Oberman [this message]
2018-11-08 15:58     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2018-11-08 16:06 [PATCHSET v2 0/2] Add queue_is_busy helper Jens Axboe
2018-11-08 16:06 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
2018-11-08 16:30   ` Bart Van Assche
2018-11-08 16:32     ` Jens Axboe

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=1541692483.24444.3.camel@redhat.com \
    --to=loberman@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).