[Devel] [PATCH vz9] ploop: fsync after all pios are sent

Alexander Atanasov alexander.atanasov at virtuozzo.com
Tue Oct 8 18:52:14 MSK 2024


Hello,

On 8.10.24 18:42, Alexey Kuznetsov wrote:
> [Some people who received this message don't often get email from alexey.n.kuznetsov at gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hello!
> 
>         if (is_data)
>                  queue_work(ploop->wq, &ploop->worker);
> -       if (is_flush)
> +       else if (is_flush)
>                  queue_work(ploop->wq, &ploop->fsync_worker);
> 
> IMHO this looks scary. bio with FLUSH must execute flush first,
> and only after completion of flush data op in this bio is executed.
> This used to be an absolute requirement since 2010. Lines
> above look like they are desynchronized whch will defintely
> lead to corruptions.

we have two unbound workequeues triggered here
- worker - which submits pios
- fsync_worker which executes the flush requests.

unbound means they run whenvever there is a free CPU.

if both are triggered simultaneously forget about any order of execution 
- both workers will race.

there is another change that runs the flush from the first worker
to try to keep the order as we see it.


-- 
Regards,
Alexander Atanasov



More information about the Devel mailing list