[Devel] [RFC PATCH vz9 v6 08/62] dm-ploop: convert enospc handling to use lockless lists
Alexander Atanasov
alexander.atanasov at virtuozzo.com
Wed Jan 15 13:59:01 MSK 2025
On 9.01.25 9:15, Pavel Tikhomirov wrote:
>
>> @@ -177,10 +180,9 @@ static bool ploop_try_delay_enospc(struct
>> ploop_rq *prq, struct pio *pio)
>> pr_err_once(PL_FMT("underlying disk is almost full"),
>> ploop_device_name(ploop));
>> - ploop->event_enospc = true;
>> - list_add_tail(&pio->list, &ploop->enospc_pios);
>> + WRITE_ONCE(ploop->event_enospc, true);
>
> Do we still need deferred_lock in ploop_get_event to protect
> event_enospc after this? Probably we can also use READ/WRITE_ONCE there.
Yes, it does test and set, so it needs a lock.
I also restored the lock here , otherwise a event can be missed.
I will rework it when i rework the timer.
Events are better delivered via queue.
--
Regards,
Alexander Atanasov
More information about the Devel
mailing list