[Devel] [PATCH RHEL7 COMMIT] ploop: fix check_zero optimization v2
Konstantin Khorenko
khorenko at odin.com
Mon May 18 21:27:02 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 a4d6baccc4792451330b47c9fd1b70fa3c73f73c
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date: Tue May 19 08:27:02 2015 +0400
ploop: fix check_zero optimization v2
We can skip zero writes only if all lower deltas has no mapping for given cluser.
Let's use map_index_fault() as we do it for unaligned requests.
https://jira.sw.ru/browse/PSBM-23452
Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
Acked-by: Maxim V. Patlasov <mpatlasov at parallels.com>
---
drivers/block/ploop/dev.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index e3422d8..0124349 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2148,24 +2148,28 @@ delta_io:
&sbl, iblk, 1<<plo->cluster_log);
}
} else {
- if (!whole_block(plo, preq)) {
- if (map_index_fault(preq) == 0) {
+ if (!whole_block(plo, preq) && map_index_fault(preq) == 0) {
__TRACE("f %p %u\n", preq, preq->req_cluster);
return;
- }
- } else {
- plo->st.bio_alloc_whole++;
}
if (plo->tune.check_zeros && check_zeros(&preq->bl)) {
+ if (map_index_fault(preq) == 0) {
+ __TRACE("f %p %u\n", preq, preq->req_cluster);
+ return;
+ }
preq->eng_state = PLOOP_E_COMPLETE;
/* Not ploop_complete_request().
* This can be TRANS request.
*/
ploop_complete_io_state(preq);
+ if(whole_block(plo, preq))
+ plo->st.bio_alloc_whole++;
plo->st.bio_wzero++;
return;
}
+ if(whole_block(plo, preq))
+ plo->st.bio_alloc_whole++;
spin_lock_irq(&plo->lock);
ploop_add_lockout(preq, 0);
More information about the Devel
mailing list