lkml.org 
[lkml]   [2014]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] block: mq flush: fix race between IPI handler and mq flush worker
From
On Mon, May 19, 2014 at 11:18 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Mon, May 19, 2014 at 11:05:50PM +0800, Ming Lei wrote:
>> Another simple fix is to disable ipi for flush request, but looks
>> this one should be better.
>
> I think the first thing is to bite the bullet and sort out and document
> the various unions in struct request for real.

Considered the problem can be reproduced easily and cause
data loss on kvm-guest, I hope fix can be seen in 3.15. Also
it should be backported to 3.14 because someone may
enable ctx->ipi_redirect.

Thinking it further, looks the patch is fine:

- sizeof(call_single_data) and sizeof(work_struct) is very close
and both are not small, so it is reasonable to put the two in
one union for saving request space

- the conflict on the two structures just happens with flush
requests because rq->requeue_work is only used to queue
flush requests

- in the flush sequence, the conflict won't happen on request
with data, so it only happens with completing and queueing
PREFLUSH/POSTFLUSH request.

Any comments and suggestions?


Thanks,
--
Ming Lei


\
 
 \ /
  Last update: 2014-05-20 06:01    [W:0.185 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site