[Devel] [PATCH rh7 6/9] ploop: remove preflush from dio_submit

Maxim Patlasov mpatlasov at virtuozzo.com
Fri Jun 24 10:05:32 PDT 2016


On 06/24/2016 07:42 AM, Dmitry Monakhov wrote:
> Maxim Patlasov <mpatlasov at virtuozzo.com> writes:
>
>> After commit c2247f3745 fixing barriers for ordinary
>> requests and previous patch fixing delay_fua,
>> that legacy code in dio_submit processing
>> (preq->req_rw & REQ_FLUSH) by setting REQ_FLUSH in
>> the first outgoing bio must die: it is incorrect
>> anyway (we don't wait for completion of the first
>> bio before sending others).
> Wow. This is so true. BTW: Reasonable way to handle FLUSH
> is to queue such preq to preflush_queue similar to fsync_queue for
> fsync_thread infrastructure

This would add another WAIT. Sometimes it may be beneficial (many 
incoming bio-s marked as REQ_FLUSH), sometimes not (only one bio with 
REQ_FLUSH -- so we'll mark only one of outgoing bio-s with REQ_FLUSH). 
Who knows how often we have more than one REQ_FLUSH in queue...


>
>> Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
>> ---
>>   drivers/block/ploop/io_direct.c |    7 -------
>>   1 file changed, 7 deletions(-)
>>
>> diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
>> index 1ea2008..ee3cd5c 100644
>> --- a/drivers/block/ploop/io_direct.c
>> +++ b/drivers/block/ploop/io_direct.c
>> @@ -89,15 +89,12 @@ dio_submit(struct ploop_io *io, struct ploop_request * preq,
>>   	sector_t sec, nsec;
>>   	int err;
>>   	struct bio_list_walk bw;
>> -	int preflush;
>>   	int postfua = 0;
>>   	int write = !!(rw & REQ_WRITE);
>>   	int delayed_fua = 0;
>>   
>>   	trace_submit(preq);
>>   
>> -	preflush = !!(rw & REQ_FLUSH);
>> -
>>   	if (test_and_clear_bit(PLOOP_REQ_FORCE_FUA, &preq->state))
>>   		postfua = 1;
>>   
>> @@ -236,10 +233,6 @@ flush_bio:
>>   		b->bi_private = preq;
>>   		b->bi_end_io = dio_endio_async;
>>   
>> -		if (unlikely(preflush)) {
>> -			rw2 |= REQ_FLUSH;
>> -			preflush = 0;
>> -		}
>>   		if (unlikely(postfua && !bl.head))
>>   			rw2 |= REQ_FUA;
>>   



More information about the Devel mailing list