All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Damien Le Moal <Damien.LeMoal@wdc.com>, Ming Lei <ming.lei@redhat.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Adam Manzanares <Adam.Manzanares@wdc.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/7] block: Remove bio->bi_ioc
Date: Tue, 20 Nov 2018 19:10:57 -0700	[thread overview]
Message-ID: <68806243-0094-5cbb-39fe-cea697f40b1c@kernel.dk> (raw)
In-Reply-To: <BN3PR0401MB164000EE62FE6BFF2ABE0069E7D90@BN3PR0401MB1640.namprd04.prod.outlook.com>

On 11/20/18 4:58 PM, Damien Le Moal wrote:
> On 2018/11/21 2:31, Jens Axboe wrote:
>> I think the below should fix it, we haven't necessarily setup an
>> ioc if we're just doing as passthrough request.
>>
>>
>> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
>> index 13b8dc332541..f096d8989773 100644
>> --- a/block/blk-mq-sched.c
>> +++ b/block/blk-mq-sched.c
>> @@ -34,9 +34,16 @@ EXPORT_SYMBOL_GPL(blk_mq_sched_free_hctx_data);
>>  void blk_mq_sched_assign_ioc(struct request *rq)
>>  {
>>  	struct request_queue *q = rq->q;
>> -	struct io_context *ioc = current->io_context;
>> +	struct io_context *ioc;
>>  	struct io_cq *icq;
>>  
>> +	/*
>> +	 * May not have an IO context if it's a passthrough request
>> +	 */
>> +	ioc = current->io_context;
>> +	if (!ioc)
>> +		return;
>> +
>>  	spin_lock_irq(&q->queue_lock);
>>  	icq = ioc_lookup_icq(ioc, q);
>>  	spin_unlock_irq(&q->queue_lock);
> 
> This seems reasonable to me, but I wonder why this problem was not triggering
> before. The previous code getting the ioc with the rq_ioc(bio) call was
> essentially the same and there was no "if (!ioc) return;" in
> blk_mq_sched_assign_ioc() before the patch.
> Any idea why this is popping up now ?
> 
> Ming,
> 
> Is this a new test your are running ? If this same problem triggers on stable
> kernels, Jens patch needs to go to stable too.

No, it's definitely introduced in your patches:

-                       if (e->type->icq_cache && rq_ioc(bio))
-                               blk_mq_sched_assign_ioc(rq, bio);
+                       if (e->type->icq_cache)
+                               blk_mq_sched_assign_ioc(rq);

Please run blktests on a series. Always. There's no excuse not to.

-- 
Jens Axboe


  parent reply	other threads:[~2018-11-21  2:11 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  3:51 [PATCH 0/7] Improve I/O priority handling Damien Le Moal
2018-11-19  3:51 ` [PATCH 1/7] aio: Comment use of IOCB_FLAG_IOPRIO aio flag Damien Le Moal
2018-11-19  8:12   ` Christoph Hellwig
2018-11-19  8:15   ` Johannes Thumshirn
2018-11-19  3:51 ` [PATCH 2/7] block: Remove bio->bi_ioc Damien Le Moal
2018-11-19  8:13   ` Christoph Hellwig
2018-11-19  8:16   ` Johannes Thumshirn
2018-11-19 19:07   ` Adam Manzanares
2018-11-20 17:21   ` Ming Lei
2018-11-20 17:31     ` Jens Axboe
2018-11-20 23:58       ` Damien Le Moal
2018-11-21  1:24         ` Ming Lei
2018-11-21  1:31           ` Damien Le Moal
2018-11-21  2:10         ` Jens Axboe [this message]
2018-11-21  2:14           ` Damien Le Moal
2018-11-21  2:45           ` Damien Le Moal
2018-11-21  2:48             ` Jens Axboe
2018-11-21  2:50               ` Damien Le Moal
2018-11-21  1:21       ` Ming Lei
2018-11-19  3:51 ` [PATCH 3/7] block: Fix get_task_ioprio() default return value Damien Le Moal
2018-11-19  8:16   ` Christoph Hellwig
2018-11-20  1:47     ` Damien Le Moal
2018-11-19  3:51 ` [PATCH 4/7] block: Introduce get_current_ioprio() Damien Le Moal
2018-11-19  8:17   ` Christoph Hellwig
2018-11-19  8:26   ` Johannes Thumshirn
2018-11-19 18:17   ` Adam Manzanares
2018-11-19 23:46     ` Damien Le Moal
2018-11-19  3:51 ` [PATCH 5/7] aio: Fix fallback I/O priority value Damien Le Moal
2018-11-19  8:18   ` Christoph Hellwig
2018-11-19  8:27   ` Johannes Thumshirn
2018-11-19 19:08   ` Adam Manzanares
2018-11-19  3:51 ` [PATCH 6/7] block: prevent merging of requests with different priorities Damien Le Moal
2018-11-19  8:19   ` Christoph Hellwig
2018-11-19  8:31   ` Johannes Thumshirn
2018-11-19  3:51 ` [PATCH 7/7] block: Initialize BIO I/O priority early Damien Le Moal
2018-11-19  8:19   ` Christoph Hellwig
2018-11-19 19:11   ` Adam Manzanares

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=68806243-0094-5cbb-39fe-cea697f40b1c@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Adam.Manzanares@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.