[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVXFVNivj3Y-gzto2tQAenR4fwQDUTYob703ZogUjNcz7=V5w@mail.gmail.com>
Date: Thu, 18 Sep 2014 10:13:12 +0800
From: Ming Lei <tom.leiming@...il.com>
To: David Hildenbrand <dahi@...ux.vnet.ibm.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Christian Borntraeger <borntraeger@...ibm.com>,
rusty Russell <rusty@...tcorp.com.au>,
"Michael S. Tsirkin" <mst@...hat.com>,
KVM list <kvm@...r.kernel.org>,
Virtualization List <virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org >> Linux Kernel Mailing List"
<linux-kernel@...r.kernel.org>
Subject: Re: blk-mq crash under KVM in multiqueue block code (with virtio-blk
and ext4)
On Thu, Sep 18, 2014 at 3:09 AM, David Hildenbrand
<dahi@...ux.vnet.ibm.com> wrote:
>> On Wed, Sep 17, 2014 at 10:22 PM, Jens Axboe <axboe@...nel.dk> wrote:
>> >
>> > Another way would be to ensure that the timeout handler doesn't touch hw_ctx
>> > or tag_sets that aren't fully initialized yet. But I think this is
>> > safer/cleaner.
>>
>> That may not be easy or enough to check if hw_ctx/tag_sets are
>> fully initialized if you mean all requests have been used one time.
>>
>> On Wed, Sep 17, 2014 at 10:11 PM, David Hildenbrand
>> > I was playing with a simple patch that just sets cmd_flags and action_flags to
>>
>> What is action_flags?
>
> atomic_flags, sorry :)
>
> Otherwise e.g. REQ_ATOM_STARTED could already be set due to the randomness. I
> am not sure if this is really necessary, or if it is completely shielded by the
> tag-handling code, but seemed to be clean for me to do it (and I remember it
> not being set within blk_mq_rq_ctx_init).
You are right, both cmd_flags and atomic_flags should be cleared
in blk_mq_init_rq_map().
>
>>
>> > 0. That should already be sufficient to hinder blk_mq_tag_to_rq and the calling
>> > method to do the wrong thing.
>>
>> Yes, clearing rq->cmd_flags should be enough.
>>
>> And looks better to move rq initialization to __blk_mq_free_request()
>> too, otherwise timeout still may see old cmd_flags and rq->q before
>> rq's new initialization.
>
> Yes, __blk_mq_free_request() should also reset at least rq->cmd_flags, and I
> think we can remove the initialization from __blk_mq_alloc_request().
>
> David
>
>>
>>
>> Thanks,
>
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists