[Devel] [PATCH RHEL8 COMMIT] ploop: Change arguments and rename ploop_reset_bat_update()
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Jul 2 22:43:28 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.6.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.el8
------>
commit f96ef94424e74059c1fcfc898d5dc3670e49b101
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri Jul 2 22:43:28 2021 +0300
ploop: Change arguments and rename ploop_reset_bat_update()
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
==========================
Parallel async BAT pages submission and improvements
[1-15]:
https://jira.sw.ru/browse/PSBM-124550
[16-22]:
following improvements
Kirill Tkhai (22):
ploop: Remove absolet comment
ploop: Add md and piwb cross pointers
ploop: Add @md argument to locate_new_cluster_and_attach_pio()
ploop: Refactoring in process_one_discard_pio()
ploop: Pass type argument to ploop_prepare_bat_update()
ploop: Move md is busy check to delay_if_md_busy()
ploop: Introduce batch list for md pages writeback
ploop: Check for md dirty instead of md piwb
ploop: Reread piwb after ploop_prepare_bat_update()
ploop: Change argument in ploop_prepare_bat_update()
ploop: Return md from ploop_prepare_reloc_index_wb()
ploop: Change arguments and rename ploop_reset_bat_update()
ploop: Allow parallel wb of md pages
ploop: Async md writeback
ploop: Rename ploop_submit_index_wb_sync()
ploop: Resubmit pios from main kwork
ploop: Rename process_delta_wb()
ploop: Do fsync after bat page write
ploop: Do not iterate excess clusters in notify_delta_merged()
ploop: Use kvec in ploop_delta_check_header()
ploop: Add argument to ploop_read_delta_metadata()
ploop: Underline clu and page is u32
---
drivers/md/dm-ploop-cmd.c | 6 +++---
drivers/md/dm-ploop-map.c | 17 +++++++++--------
drivers/md/dm-ploop.h | 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 96a214f373db..ea0273d558b9 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -312,7 +312,7 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
/* Write clu to new destination */
ret = ploop_write_cluster_sync(ploop, pio, new_dst);
if (ret) {
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
goto out;
}
@@ -320,7 +320,7 @@ static int ploop_grow_relocate_cluster(struct ploop *ploop,
/* Write new index on disk */
ploop_submit_index_wb_sync(ploop, piwb);
ret = blk_status_to_errno(piwb->bi_status);
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
if (ret)
goto out;
@@ -382,7 +382,7 @@ static int ploop_grow_update_header(struct ploop *ploop,
kunmap_atomic(hdr);
}
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
return ret;
}
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index c2c5a10138d0..8eb725d0b3ef 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -844,14 +844,15 @@ static int ploop_prepare_bat_update(struct ploop *ploop, struct md_page *md,
return 0;
}
-void ploop_reset_bat_update(struct ploop_index_wb *piwb)
+void ploop_break_bat_update(struct ploop *ploop, struct md_page *md)
{
- struct ploop *ploop = piwb->ploop;
+ struct ploop_index_wb *piwb;
unsigned long flags;
write_lock_irqsave(&ploop->bat_rwlock, flags);
- piwb->md->piwb = NULL;
- piwb->md = NULL;
+ piwb = md->piwb;
+ md->piwb->md = NULL;
+ md->piwb = NULL;
write_unlock_irqrestore(&ploop->bat_rwlock, flags);
put_page(piwb->bat_page);
@@ -1387,7 +1388,7 @@ static bool locate_new_cluster_and_attach_pio(struct ploop *ploop,
error:
/* Uninit piwb */
if (bat_update_prepared)
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
pio_endio(pio);
return false;
}
@@ -1533,7 +1534,7 @@ static void process_one_discard_pio(struct ploop *ploop, struct pio *pio,
return;
err:
if (bat_update_prepared)
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
pio_endio(pio);
}
@@ -1577,7 +1578,7 @@ static void submit_metadata_writeback(struct ploop *ploop)
write_unlock_irq(&ploop->bat_rwlock);
ploop_submit_index_wb_sync(ploop, md->piwb);
- ploop_reset_bat_update(md->piwb);
+ ploop_break_bat_update(ploop, md);
}
}
@@ -1841,7 +1842,7 @@ int ploop_prepare_reloc_index_wb(struct ploop *ploop,
return 0;
out_reset:
- ploop_reset_bat_update(piwb);
+ ploop_break_bat_update(ploop, md);
out_eio:
return -EIO;
}
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 5cadffba881e..7817c52c7ec2 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -540,7 +540,7 @@ extern void map_and_submit_rw(struct ploop *ploop, u32 dst_clu, struct pio *pio,
extern int ploop_prepare_reloc_index_wb(struct ploop *, struct md_page **,
struct ploop_index_wb *, unsigned int, unsigned int *);
-extern void ploop_reset_bat_update(struct ploop_index_wb *);
+extern void ploop_break_bat_update(struct ploop *ploop, struct md_page *);
extern void ploop_submit_index_wb_sync(struct ploop *, struct ploop_index_wb *);
extern int ploop_message(struct dm_target *ti, unsigned int argc, char **argv,
char *result, unsigned int maxlen);
More information about the Devel
mailing list