diff mbox series

[1/2] blk-mq: remove the RQF_ELVPRIV check in blk_mq_free_request

Message ID 20211019133944.2500822-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/2] blk-mq: remove the RQF_ELVPRIV check in blk_mq_free_request | expand

Commit Message

Christoph Hellwig Oct. 19, 2021, 1:39 p.m. UTC
If RQF_ELVPRIV is set RQF_ELV is by definition set as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Oct. 19, 2021, 1:43 p.m. UTC | #1
On 10/19/21 7:39 AM, Christoph Hellwig wrote:
> If RQF_ELVPRIV is set RQF_ELV is by definition set as well.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/blk-mq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 428e0e0fd5504..34392c439d2a8 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -580,7 +580,7 @@ void blk_mq_free_request(struct request *rq)
>  	struct request_queue *q = rq->q;
>  	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
>  
> -	if (rq->rq_flags & (RQF_ELVPRIV | RQF_ELV)) {
> +	if (rq->rq_flags & RQF_ELV) {

Actually just fixed a bug there. RQF_ELV means "we have an IO
scheduler", and RQF_ELVPRIV means that plus "we have rq private data".
The above shouldn't check RQF_ELV at all, just PRIV.
Christoph Hellwig Oct. 19, 2021, 1:44 p.m. UTC | #2
On Tue, Oct 19, 2021 at 07:43:04AM -0600, Jens Axboe wrote:
> On 10/19/21 7:39 AM, Christoph Hellwig wrote:
> > If RQF_ELVPRIV is set RQF_ELV is by definition set as well.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> >  block/blk-mq.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index 428e0e0fd5504..34392c439d2a8 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -580,7 +580,7 @@ void blk_mq_free_request(struct request *rq)
> >  	struct request_queue *q = rq->q;
> >  	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
> >  
> > -	if (rq->rq_flags & (RQF_ELVPRIV | RQF_ELV)) {
> > +	if (rq->rq_flags & RQF_ELV) {
> 
> Actually just fixed a bug there. RQF_ELV means "we have an IO
> scheduler", and RQF_ELVPRIV means that plus "we have rq private data".
> The above shouldn't check RQF_ELV at all, just PRIV.

Well, in that case RQF_ELVPRIV can be replaced with
RQF_ELV && !op_is_flush as in the next patch.  But I can resend once I
see the fix in a tree somewhere.
Jens Axboe Oct. 19, 2021, 1:46 p.m. UTC | #3
On 10/19/21 7:44 AM, Christoph Hellwig wrote:
> On Tue, Oct 19, 2021 at 07:43:04AM -0600, Jens Axboe wrote:
>> On 10/19/21 7:39 AM, Christoph Hellwig wrote:
>>> If RQF_ELVPRIV is set RQF_ELV is by definition set as well.
>>>
>>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>>> ---
>>>  block/blk-mq.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/block/blk-mq.c b/block/blk-mq.c
>>> index 428e0e0fd5504..34392c439d2a8 100644
>>> --- a/block/blk-mq.c
>>> +++ b/block/blk-mq.c
>>> @@ -580,7 +580,7 @@ void blk_mq_free_request(struct request *rq)
>>>  	struct request_queue *q = rq->q;
>>>  	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
>>>  
>>> -	if (rq->rq_flags & (RQF_ELVPRIV | RQF_ELV)) {
>>> +	if (rq->rq_flags & RQF_ELV) {
>>
>> Actually just fixed a bug there. RQF_ELV means "we have an IO
>> scheduler", and RQF_ELVPRIV means that plus "we have rq private data".
>> The above shouldn't check RQF_ELV at all, just PRIV.
> 
> Well, in that case RQF_ELVPRIV can be replaced with
> RQF_ELV && !op_is_flush as in the next patch.  But I can resend once I
> see the fix in a tree somewhere.

That'd be great. It's in for-5.16/block
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 428e0e0fd5504..34392c439d2a8 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -580,7 +580,7 @@  void blk_mq_free_request(struct request *rq)
 	struct request_queue *q = rq->q;
 	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
 
-	if (rq->rq_flags & (RQF_ELVPRIV | RQF_ELV)) {
+	if (rq->rq_flags & RQF_ELV) {
 		struct elevator_queue *e = q->elevator;
 
 		if (e->type->ops.finish_request)