lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 21 May 2014 14:48:58 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	Christoph Hellwig <hch@....de>
Cc:	Jens Axboe <axboe@...nel.dk>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	stable <stable@...r.kernel.org>
Subject: Re: [PATCH] block: mq flush: fix race between IPI handler and mq
 flush worker

On Wed, May 21, 2014 at 1:36 PM, Christoph Hellwig <hch@....de> wrote:
> On Wed, May 21, 2014 at 01:16:14PM +0800, Ming Lei wrote:
>> I am wondering if virtio-blk is trivial block driver, :-)
>
> It's about as simple as it gets.
>
>> > The scsi-mq work that I plant to submit for the next merge window is
>> > the prime example.
>>
>> It depends if one scsi-mq req has to requeue itself with rq->requeue_work
>> inside its own .softirq_done_fn. If yes, we can't put call_single_data
>> and requeue_work into one union simply. From you last scsi-mq post,
>> looks the request may do that if I understand correctly.
>
> Requeueing a request from the completion handler is indeed what we'll
> need with various more complete drivers.

At least for scsi, the current scsi_cmnd->abort_work(reusing) should
be enough for requeing the command. For other drivers, maybe
they can make use of something like scsi_cmnd->abort_work too.

>
>> I think the patch is clean and simple, with documenting the special
>> conflict case clearly too.
>
> While I can't say anything against the fact that it fixes the issue
> it's neither clean nor simple.

It just uses q->flush_rq's own work_struct for requeuing itself,
that is it. I'd like to see a cleaner/simpler solution without wasting
space and extra complexity.

>
>> Follows current ideas:
>> 1), this patch with scsi-mq sharing abort_work together?
>> 2), move requeue_work out of the union inside request
>> 3), spin_lock_irqsave(&ctx->lock) everywhere and requeue
>> request directly to ctx without using work
>
> I think Jens very much wanted to avoid irq disabling in the I/O path
> if possible. If we have a separate requeue list with it's separate
> lock we can avoid that unless we actually have to take requests of
> that requeue list.  I can look into that implementation.

I am wondering if you can keep requests in order per blk-mq ctx
since you introduce another list.


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ