[Devel] [PATCH RHEL8 COMMIT] ploop: Manage flush pios in generic way
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Jul 2 22:47:58 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.51
------>
commit ffc9029167826980a7f1ce27119f3df49083e176
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri Jul 2 22:47:58 2021 +0300
ploop: Manage flush pios in generic way
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
==========================
ploop: Split pios in kwork
https://jira.sw.ru/browse/PSBM-131208
Kirill Tkhai (10):
ploop: Remove debug noinline in create_bvec_from_rq()
ploop: Manage flush pios in generic way
ploop: Teach dispatch_pios() work with flush pios
ploop: Make split_pios_to_list() to add initial pio to the list too
ploop: Introduce embedded_pio_to_prq()
ploop: Introduce ploop_prq_valid()
ploop: Move create_bvec_from_rq() up
ploop: Split pios from kwork context
ploop: Add sanity check of passed BAT from disk
ploop: Reread file size after index update
---
drivers/md/dm-ploop-map.c | 6 +++---
drivers/md/dm-ploop-target.c | 1 -
drivers/md/dm-ploop.h | 4 ++--
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 1341806dc6c4..5c8375636eac 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1496,7 +1496,7 @@ static void md_write_endio(struct pio *pio, void *piwb_ptr, blk_status_t bi_stat
pio->endio_cb_data = piwb;
spin_lock_irqsave(&ploop->deferred_lock, flags);
- list_add_tail(&pio->list, &ploop->flush_pios);
+ list_add_tail(&pio->list, &ploop->pios[PLOOP_LIST_FLUSH]);
spin_unlock_irqrestore(&ploop->deferred_lock, flags);
queue_work(ploop->wq, &ploop->fsync_worker);
}
@@ -1661,7 +1661,7 @@ void do_ploop_fsync_work(struct work_struct *ws)
int ret;
spin_lock_irq(&ploop->deferred_lock);
- list_splice_init(&ploop->flush_pios, &flush_pios);
+ list_splice_init(&ploop->pios[PLOOP_LIST_FLUSH], &flush_pios);
spin_unlock_irq(&ploop->deferred_lock);
file = top_delta(ploop)->file;
@@ -1725,7 +1725,7 @@ static void submit_pio(struct ploop *ploop, struct pio *pio)
goto endio;
}
} else {
- queue_list = &ploop->flush_pios;
+ queue_list = &ploop->pios[PLOOP_LIST_FLUSH];
worker = &ploop->fsync_worker;
if (WARN_ON_ONCE(pio->bi_op != REQ_OP_FLUSH))
diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 705f2252e822..c69e18bfa13d 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -330,7 +330,6 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
for (i = 0; i < PLOOP_LIST_COUNT; i++)
INIT_LIST_HEAD(&ploop->pios[i]);
- INIT_LIST_HEAD(&ploop->flush_pios);
INIT_LIST_HEAD(&ploop->resubmit_pios);
INIT_LIST_HEAD(&ploop->enospc_pios);
INIT_LIST_HEAD(&ploop->cluster_lk_list);
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 50663d8aa219..8b5156128889 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -124,6 +124,7 @@ struct md_page {
enum {
PLOOP_LIST_DEFERRED = 0,
+ PLOOP_LIST_FLUSH,
PLOOP_LIST_DISCARD,
PLOOP_LIST_COW,
@@ -188,7 +189,6 @@ struct ploop {
struct list_head pios[PLOOP_LIST_COUNT];
- struct list_head flush_pios;
struct list_head resubmit_pios; /* After partial IO */
struct list_head enospc_pios; /* Delayed after ENOSPC */
@@ -258,7 +258,7 @@ struct pio {
#define PLOOP_REF_INDEX_INVALID 2
unsigned int ref_index:2;
- u8 queue_list_id:2; /* id in ploop->pios */
+ u8 queue_list_id:3; /* id in ploop->pios */
struct ploop_index_wb *piwb;
More information about the Devel
mailing list