[Devel] [PATCH RHEL7 COMMIT] ploop: define struct ploop_request->state flags to force pre FLUSH before write IO and FUA/fsync at I/O complete
Konstantin Khorenko
khorenko at odin.com
Mon May 18 21:27:13 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.1
------>
commit ebf1008ff2e19354244317140b41ae3c2854f74b
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date: Tue May 19 08:27:13 2015 +0400
ploop: define struct ploop_request->state flags to force pre FLUSH before write IO and FUA/fsync at I/O complete
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 such defines to force FUA/FLUSH/fsync in direct/kaio modules.
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>
Reviewed-by: Andrew Vagin <avagin at parallels.com>
---
include/linux/ploop/ploop.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index d8b83a6..73280e0 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -456,6 +456,9 @@ enum
PLOOP_REQ_ZERO,
PLOOP_REQ_DISCARD,
PLOOP_REQ_RSYNC,
+ PLOOP_REQ_FORCE_FUA, /*force fua of req write I/O by engine */
+ PLOOP_REQ_FORCE_FLUSH, /*force flush by engine */
+ PLOOP_REQ_KAIO_FSYNC, /*force image fsync by KAIO module */
};
enum
More information about the Devel
mailing list