[Devel] [RFC PATCH vz9 v6 21/62] dm-ploop: introduce per-md page locking
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue Jan 14 07:03:35 MSK 2025
On 12/6/24 05:55, Alexander Atanasov wrote:
> @@ -411,7 +415,6 @@ static void ploop_apply_delta_mappings(struct ploop *ploop,
> if (!is_raw)
> d_md = ploop_md_first_entry(md_root);
>
> - write_lock_irq(&ploop->bat_rwlock);
> ploop_for_each_md_page(ploop, md, node) {
> bat_entries = md->kmpage;
> if (!is_raw)
> @@ -455,7 +458,6 @@ static void ploop_apply_delta_mappings(struct ploop *ploop,
> if (!is_raw)
> d_md = ploop_md_next_entry(d_md);
> }
> - write_unlock_irq(&ploop->bat_rwlock);
> }
>
> int ploop_check_delta_length(struct ploop *ploop, struct file *file, loff_t *file_size)
This is not possible to remove this lock, as ploop->bat_entries rbtree
is protected by it. In other words ploop_for_each_md_page should be
protected by critical section against concurrent ploop_add_md_pages.
--
Best regards, Tikhomirov Pavel
Senior Software Developer, Virtuozzo.
More information about the Devel
mailing list