Re: [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
+}
+



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux