[Devel] [PATCH rh7 35/38] ploop: mark reloc reqs to force FUA before write of relocated data
Andrey Smetanin
asmetanin at virtuozzo.com
Fri May 15 09:48:36 PDT 2015
Series description:
During relocation of ploop clusters (resize/baloon) we need to FUA/fsync
image file after such operations:
a) new data block wrote
b) BAT update
c) nullify old data block for BAT grow. We do this already nullify of old data
block at format module -> complete_grow callback.
This patch forses fsync(kaio), FUA(direct) of reloc write I/O to image
by marking such reloc reqs(A|S) with appropriate flags. Kaio/direct modules
tuned by patch to force fsync/FUA if these flags are set. This code does
FUA/fsync only for a) and b) cases, while c) already implemented.
Also patch fixes inconsistent bio list FUA processing in direct module.
The problem is that for bunch of bios we only set FUA at last bio. Its possible
in case of power outage that last bio will be stored and previos are not
because they are stored only in cache at the time of power failure.
To solve problem this patch marking last bio as FLUSH|FUA if more than one bio
in list.
Moreover for KAIO if fsync possible at BAT update stage we do that like we
did in direct case instead of 2 fsync's. For direct case if we going to make
FUA at BAT update only(optimization trick that already exists) then we need
to mark req to FLUSH previously written(without FUA) data.
Performance:
Overall(includes EXT4 resize upto 16T) resize performance degradated by -5% of
time.
https://jira.sw.ru/browse/PSBM-31222
https://jira.sw.ru/browse/PSBM-31225
https://jira.sw.ru/browse/PSBM-31321
Signed-off-by: Andrey Smetanin <asmetanin at parallels.com>
Andrey Smetanin (7):
ploop: define struct ploop_request->state flags to force pre FLUSH
before write IO and FUA/fsync at I/O complete
ploop: mark reloc reqs to force FUA/fsync(kaio) for index update I/O
ploop: mark reloc reqs to force FUA before write of relocated data
ploop: direct: to support truly FLUSH/FUA of req we need mark first
bio FLUSH, write all bios and mark last bio as FLUSH/FUA
ploop: added ploop_req_delay_fua_possible() func that detects possible
delaying of upcoming FUA to index update stage. This function will
be lately used in direct/kaio code to detect and delay FUA
ploop: make image fsync at I/O complete if it's required by FUA/fsync
force flag or by req->req_rw
ploop: do preflush or postfua according force FUA/flush flags, and
delay FUA if possible but add force FLUSH to req if so
This patch description:
Need to force FUA/fsync of relocated data write for consistent resize.
Signed-off-by: Andrey Smetanin <asmetanin at parallels.com>
Reviewed-by: Andrew Vagin <avagin at parallels.com>
---
drivers/block/ploop/dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index ac0f28f..bd5fe37 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2434,6 +2434,9 @@ restart:
top_delta = ploop_top_delta(plo);
sbl.head = sbl.tail = preq->aux_bio;
+ /* Relocated data write required sync before BAT updatee */
+ set_bit(PLOOP_REQ_FORCE_FUA, &preq->state);
+
if (test_bit(PLOOP_REQ_RELOC_S, &preq->state)) {
preq->eng_state = PLOOP_E_DATA_WBI;
plo->st.bio_out++;
--
1.9.3
More information about the Devel
mailing list