[Devel] [PATCH RHEL7 COMMIT] vziolimit: port diff-ubc-iolimit-rework-async-iops-limit

Konstantin Khorenko khorenko at odin.com
Tue May 5 02:44:41 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.4.9
------>
commit 351183df592c114604899c7c2c21aac0af75f773
Author: Dmitry Monakhov <dmonakhov at openvz.org>
Date:   Tue May 5 13:44:41 2015 +0400

    vziolimit: port diff-ubc-iolimit-rework-async-iops-limit
    
    iolimit: rework async iops limit
    
    Now async IO will not use last iops from stash, it will slowdown sync IO,
    but should not choke it. Thus async writeback sometimes becomes free,
    we anyway cannot limit iops correctly for this case.
    
    test results:
    
    [ container iops limit 10 iops/sec, ramlimit 256mb, file 1gb ]
    # ioping -P 1 -q -i 0 -WWW -L -s 4k zero
    [ cached random 4k writes, print statistics every second ]
    
    before patch:
    
    1 27388042 0 150 27388042 27388042 27388042 0
    20496 10137323 2022 8281438 1 495 10091730 70489
    1 15686980 0 261 15686980 15686980 15686980 0
    14350 10145229 1414 5793620 1 707 10097028 84285
    1 28054974 0 146 28054974 28054974 28054974 0
    20473 10137498 2020 8272002 1 495 10092918 70537
    
    iops not limited at all (3rd column),
    but max latency (7th column) > 15 sec
    
    after patch:
    
    2048 957784 2138 8758351 1 468 526912 14975
    2048 1157707 1769 7245882 1 565 626641 18083
    1024 628864 1628 6669652 1 614 626675 19574
    2048 1459687 1403 5746854 1 713 826885 22916
    2048 759792 2695 11040664 1 371 428803 11907
    2048 864740 2368 9700729 1 422 433732 13439
    2048 860729 2379 9745934 1 420 429865 13376
    
    iops not limited, but latency is sane now
    
    meanwhile iops on sync writeback (fsync after each write) perfectly limited:
    
    # ioping -P 1 -q -i 0 -WWW -s 4k zero
    
    10 999898 10 40964 99945 99990 100012 17
    10 999933 10 40963 99979 99993 100010 11
    10 999934 10 40963 99908 99993 100066 38
    10 1000939 10 40922 99927 100094 101054 321
    10 999911 10 40964 99973 99991 100006 10
    10 999933 10 40963 99976 99993 100014 13
    
    Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
    
    ====================================
    https://jira.sw.ru/browse/PSBM-20104
    
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 kernel/ve/vziolimit.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/ve/vziolimit.c b/kernel/ve/vziolimit.c
index 19dd7ad..890d7e8 100644
--- a/kernel/ve/vziolimit.c
+++ b/kernel/ve/vziolimit.c
@@ -181,7 +181,13 @@ static int iolimit_virtinfo(struct vnotifier_block *nb,
 			spin_lock_irqsave(&ub->ub_lock, flags);
 			if (iolimit->iops.speed) {
 				throttle_charge(&iolimit->iops, 1);
-				iolimit->iops.state--;
+				/*
+				 * Writeback doesn't use last iops from stash
+				 * to avoid choking future sync operations.
+				 */
+				if (iolimit->iops.state > 1 ||
+				    !(current->flags & PF_FLUSHER))
+					iolimit->iops.state--;
 			}
 			spin_unlock_irqrestore(&ub->ub_lock, flags);
 			break;



More information about the Devel mailing list