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

2018-11-08 Thread Jens Axboe
On 11/8/18 9:30 AM, Bart Van Assche wrote: > On Thu, 2018-11-08 at 09:06 -0700, Jens Axboe wrote: >> +static bool blk_mq_check_busy(struct blk_mq_hw_ctx *hctx, struct request >> *rq, >> + void *priv, bool reserved) >> +{ >> +/* >> + * If we find a request, we know

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

2018-11-08 Thread Bart Van Assche
On Thu, 2018-11-08 at 09:06 -0700, Jens Axboe wrote: > +static bool blk_mq_check_busy(struct blk_mq_hw_ctx *hctx, struct request *rq, > + void *priv, bool reserved) > +{ > + /* > + * If we find a request, we know the queue is busy. Return false > + * to stop

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

2018-11-08 Thread Jens Axboe
Returns true if the queue currently has requests pending, false if not. DM can use this to replace the atomic_inc/dec they do per device to see if a device is busy. Reviewed-by: Mike Snitzer Signed-off-by: Jens Axboe --- block/blk-mq.c | 26 ++ include/linux/blk

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

2018-11-08 Thread Jens Axboe
On 11/8/18 8:54 AM, Laurence Oberman wrote: > 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; >> + >> + 

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

2018-11-08 Thread Laurence Oberman
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 t

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

2018-11-08 Thread Mike Snitzer
On Thu, Nov 08 2018 at 10:42am -0500, Jens Axboe wrote: > Returns true if the queue currently has requests pending, > false if not. > > DM can use this to replace the atomic_inc/dec they do per device > to see if a device is busy. > > Cc: Mike Snitzer > Signed-off-by: Jens Axboe Reviewed-by:

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

2018-11-08 Thread Jens Axboe
Returns true if the queue currently has requests pending, false if not. DM can use this to replace the atomic_inc/dec they do per device to see if a device is busy. Cc: Mike Snitzer Signed-off-by: Jens Axboe --- block/blk-mq.c | 22 ++ include/linux/blk-mq.h | 2 ++