[Devel] [RFC PATCH vz9 v4 13/33] dm-ploop: complete conversion of enospc and suspended pios to lockless
Alexander Atanasov
alexander.atanasov at virtuozzo.com
Mon Nov 4 13:59:08 MSK 2024
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
drivers/md/dm-ploop-cmd.c | 12 ++----------
drivers/md/dm-ploop-map.c | 12 ++----------
drivers/md/dm-ploop.h | 2 +-
3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 006495d95db3..115efdf092d3 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -123,7 +123,6 @@ ALLOW_ERROR_INJECTION(ploop_inflight_bios_ref_switch, ERRNO);
static void ploop_resume_submitting_pios(struct ploop *ploop)
{
- LIST_HEAD(list);
struct llist_node *suspended_pending;
spin_lock_irq(&ploop->deferred_lock);
@@ -132,15 +131,8 @@ static void ploop_resume_submitting_pios(struct ploop *ploop)
spin_unlock_irq(&ploop->deferred_lock);
suspended_pending = llist_del_all(&ploop->llsuspended_pios);
- if (suspended_pending) {
- struct llist_node *pos, *t;
- suspended_pending = llist_reverse_order(suspended_pending);
- llist_for_each_safe(pos, t, suspended_pending) {
- struct pio *pio = list_entry((struct list_head *)pos, typeof(*pio), list);
- list_add(&pio->list, &list);
- }
- ploop_submit_embedded_pios(ploop, &list);
- }
+ if (suspended_pending)
+ ploop_submit_embedded_pios(ploop, llist_reverse_order(suspended_pending));
}
static int ploop_suspend_submitting_pios(struct ploop *ploop)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 7acb86ad8b46..9715bca3e39e 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -144,18 +144,10 @@ static void ploop_init_prq_and_embedded_pio(struct ploop *ploop,
void ploop_enospc_timer(struct timer_list *timer)
{
struct ploop *ploop = from_timer(ploop, timer, enospc_timer);
- LIST_HEAD(list);
- struct llist_node *pos, *t;
struct llist_node *enospc_pending = llist_del_all(&ploop->enospc_pios);
- if (enospc_pending) {
- enospc_pending = llist_reverse_order(enospc_pending);
- llist_for_each_safe(pos, t, enospc_pending) {
- struct pio *pio = list_entry((struct list_head *)pos, typeof(*pio), list);
- list_add(&pio->list, &list);
- }
- ploop_submit_embedded_pios(ploop, &list);
- }
+ if (enospc_pending)
+ ploop_submit_embedded_pios(ploop, llist_reverse_order(enospc_pending));
}
void do_ploop_event_work(struct work_struct *ws)
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 803f3f324550..a5eab5bad596 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -571,7 +571,7 @@ extern int ploop_add_delta(struct ploop *ploop, u32 level,
extern int ploop_check_delta_length(struct ploop *ploop, struct file *file,
loff_t *file_size);
extern void ploop_submit_embedded_pios(struct ploop *ploop,
- struct list_head *list);
+ struct llist_node *list);
extern void ploop_dispatch_pios(struct ploop *ploop, struct pio *pio,
struct list_head *pio_list);
extern void do_ploop_work(struct work_struct *ws);
--
2.43.0
More information about the Devel
mailing list