Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbZFHRkY (ORCPT ); Mon, 8 Jun 2009 13:40:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752504AbZFHRkK (ORCPT ); Mon, 8 Jun 2009 13:40:10 -0400 Received: from mail-bw0-f213.google.com ([209.85.218.213]:46618 "EHLO mail-bw0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbZFHRkF (ORCPT ); Mon, 8 Jun 2009 13:40:05 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=WUMBWmg3GS50tbIA63eKMgxFw2iiohePT6XAefawqXGIdkTgf1VaYFHp6yWQxRQKK0 G+ldh22FJkrR7HgBLZYkUypJvi6PHJFrd0VnfNIvH8HvmEaAC9zRPJeU485tUWk/RnsO MwehSlMXA6FIHmsrAasV//9FHztt4cSnlcjYs= MIME-Version: 1.0 Date: Mon, 8 Jun 2009 19:40:05 +0200 Message-ID: <4e5e476b0906081040l4a188b2fwad27ebe715b61daf@mail.gmail.com> Subject: Low latency I/O scheduling From: Corrado Zoccolo To: Linux-Kernel , Jens Axboe Content-Type: multipart/mixed; boundary=00504502d531882125046bd9bb22 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 65769 Lines: 944 --00504502d531882125046bd9bb22 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, sometime ago on the mailing list, the issue of too high latencies introduced by I/O scheduling was raised. I've done some study, and identified a way to improve on workloads that have >1 random readers. The problem: CFQ partitions the requests into queues, so that requests coming from different processes are in different queues. Each queue will get its timeslice. If there are many processes, the number of queues will increase linearly, and the I/O latency will as well. This works well if the processes are doing sequential I/O, in fact in the timeslice, subsequent requests will complete much faster. But for random I/O, we introduce too much latency, without getting back bandwidth improvement. The solution: Divide the requests in two classes. Sequential requests are put in per-process queues, while random requests are put in a shared data structure (e.g. RB-tree), and we alternate between serving the sequential queues and the random data structure. A proof-of-concept implementation of the idea, based on AS (called 'fas' = Fair Anticipatory Scheduling in the following), is provided in the attached file. I conducted some tests (attached the fio configuration to replicate them), and I got the following improvements: 2 parallel readers (both random) test: * fas has lowest max and avg latencies, even lower than noop. 4 random readers/1 seq writer test: * max latency is lowest for fas (218ms, compared with 617ms of CFQ). CFQ has slightly lower avg latency, probably due to different bandwidth allocation between readers and writer. 32 random readers/1 seq writer test: * fas has lowest max and avg latency: 1.314s and 304ms resp., compared with CFQ: 7.63s, 391ms resp. (while still providing higher bandwidth both to the readers and the writer than CFQ). When < 2 random readers are present, the heuristics doesn't matter, but the tests show slight performance differences with CFQ, mainly due to different time shares allocations. In particular, one relevant difference is that time allocated to each process performing sequential I/O is inversely proportional to the number of those processes (but has a guaranteed minimum), and balance between sequential and random I/O is done by varying the total time allowed for sequential processes. All test results data follows (all tables are sorted by bandiwdth): Sequential read test: BW (KiB/s), max latency (ms), avg latency (ms) noop: 32457, 18, 0.124 deadline: 31746, 21, 0.127 as: 31014, 18, 0.13 fas: 30229, 18, 0.134 cfq: 30138, 18, 0.134 Sequential write test: BW (KiB/s), max latency (ms), avg latency (ms) as: 28082, 473, 0.132 noop: 27851, 283, 0.134 fas: 27417, 309, 0.136 deadline: 26971, 1924, 0.138 cfq: 26626, 414, 0.132 2 parallel readers (both sequential) test: Aggr BW (KiB/s), max latency (ms), avg latency (ms) fas: 31924 , 311, 0.255 cfq: 31916 , 150, 0.255 as: 31863 , 260, 0.255 noop: 20690, 64, 0.394 deadline: 20196, 64, 0.404 2 parallel readers (1 seq, 1 random): Random BW (KiB/s), Seq BW (KiB/s), max latency (ms), avg latency (ms) fas: 195, 16681, 186, 10 cfq: 191, 16129, 152, 10 as: 95, 24611, 269, 21 deadline: 75, 13581, 101, 27 noop: 72, 13240, 102, 28 2 parallel writers (both sequential) test: Aggr BW (KiB/s), max latency (ms), avg latency (ms) noop: 25979, 573, 0.286 fas: 25972, 1264, 0.266 as: 25131, 1025, 0.2745 deadline: 25086, 899, 0.276 cfq: 23469, 1066, 0.311 2 parallel readers (both random) test: Aggr BW (KiB/s), max latency (ms), avg latency (ms) as: 477, 173, 17 fas: 458, 39, 17 deadline: 456, 48, 17 cfq: 451, 136, 18 noop: 450, 44, 18 4 random readers/1 seq writer test: READ: Aggr BW (KiB/s), max latency (ms), avg latency (ms) cfq: 425, 617, 30 fas: 402, 218, 32 deadline: 389, 235, 33 as: 361, 340, 36 noop: 96, 400, 135 WRITE: BW (KiB/s), max latency (ms), avg latency (ms) noop: 21920, 354, 0.037 as: 10014, 3493, 0.0814 deadline: 7665, 5383, 0.1064 fas: 5669, 10599, 0.144 cfq: 4009, 15076, 0.2038 32 random readers/1 seq writer test: READ: Aggr BW (KiB/s), max latency (ms), avg latency (ms) fas: 414, 1314, 304 deadline: 363, 1704, 345 cfq: 326, 7630, 391 as: 319, 1919, 395 noop: 66, 2132, 1526 WRITE: BW (KiB/s), max latency (ms), avg latency (ms) noop: 19839, 784, 0.0053 as: 18302, 8534, 0.0059 fas: 4416, 23507, 0.025 cfq: 3792, 16797, 0.026 deadline: 2484, 5629, 0.042 -- __________________________________________________________________________ dott. Corrado Zoccolo mailto:czoccolo@gmail.com PhD - Department of Computer Science - University of Pisa, Italy -------------------------------------------------------------------------- --00504502d531882125046bd9bb22 Content-Type: text/x-csrc; charset=US-ASCII; name="fas-iosched.c" Content-Disposition: attachment; filename="fas-iosched.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fvnrh72v2 LyogLSotIG1vZGU6QzsgdGFiLXdpZHRoOjg7IGMtYmFzaWMtb2Zmc2V0OjggLSotCiAqICBBbnRp Y2lwYXRvcnkgJiBkZWFkbGluZSBpL28gc2NoZWR1bGVyLgogKgogKiAgQ29weXJpZ2h0IChDKSAy MDAyIEplbnMgQXhib2UgPGF4Ym9lQGtlcm5lbC5kaz4KICogICAgICAgICAgICAgICAgICAgICBO aWN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pNT0RVTEVfTElD RU5TRSgiR1BMIik7Ck1PRFVMRV9ERVNDUklQVElPTigiRmFpciBBbnRpY2lwYXRvcnkgSU8gc2No ZWR1bGVyIik7Cg== --00504502d531882125046bd9bb22 Content-Type: application/octet-stream; name="test2.fio" Content-Disposition: attachment; filename="test2.fio" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fvnrhj3p3 W3NlcXJlYWRdCmRpcmVjdG9yeT0vbW50L3Rlc3QvY29ycmFkbwpydz1yZWFkCnNpemU9MUcKcnVu dGltZT0zMAppb2VuZ2luZT1wc3luYwpmaWxlbmFtZT1zcmVhZAoKW3NlcXdyaXRlXQpzdG9uZXdh bGwKZGlyZWN0b3J5PS9tbnQvdGVzdC9jb3JyYWRvCnJ3PXdyaXRlCnNpemU9MUcKcnVudGltZT0z MAppb2VuZ2luZT1wc3luYwpmaWxlbmFtZT1zd3JpdGUKZW5kX2ZzeW5jPTEKb3ZlcndyaXRlPTEK CltwYXJyZWFkLjBdCnN0b25ld2FsbApkaXJlY3Rvcnk9L21udC90ZXN0L2NvcnJhZG8Kcnc9cmVh ZApzaXplPTI1Nk0KcnVudGltZT0zMAppb2VuZ2luZT1wc3luYwpmaWxlbmFtZT1wcmVhZC4wCgpb cGFycmVhZC4xXQpkaXJlY3Rvcnk9L21udC90ZXN0L2NvcnJhZG8Kcnc9cmVhZApzaXplPTI1Nk0K cnVudGltZT0zMAppb2VuZ2luZT1wc3luYwpmaWxlbmFtZT1wcmVhZC4xCgpbcGFycmVhZC5zXQpz dG9uZXdhbGwKZGlyZWN0b3J5PS9tbnQvdGVzdC9jb3JyYWRvCnJ3PXJlYWQKc2l6ZT0xRwpydW50 aW1lPTMwCmlvZW5naW5lPXBzeW5jCmZpbGVuYW1lPXNyZWFkCgpbcGFycmVhZC5yXQpkaXJlY3Rv cnk9L21udC90ZXN0L2NvcnJhZG8Kcnc9cmFuZHJlYWQKc2l6ZT0xRwpydW50aW1lPTMwCmlvZW5n aW5lPXBzeW5jCmZp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pcmVjdG9yeT0vbW50 L3Rlc3QvY29ycmFkbwpydz1yYW5kcmVhZApzaXplPTJHCnJ1bnRpbWU9MzAKaW9lbmdpbmU9cHN5 bmMKZmlsZW5hbWU9cmFuZG9tcmVhZC4yLjAKCltyYW5kb21yZWFkc2Vxd3JpdGVzNS4yOF0KZGly ZWN0b3J5PS9tbnQvdGVzdC9jb3JyYWRvCnJ3PXJhbmRyZWFkCnNpemU9MkcKcnVudGltZT0zMApp b2VuZ2luZT1wc3luYwpmaWxlbmFtZT1yYW5kb21yZWFkLjIuMAoKW3JhbmRvbXJlYWRzZXF3cml0 ZXM1LjI5XQpkaXJlY3Rvcnk9L21udC90ZXN0L2NvcnJhZG8Kcnc9cmFuZHJlYWQKc2l6ZT0yRwpy dW50aW1lPTMwCmlvZW5naW5lPXBzeW5jCmZpbGVuYW1lPXJhbmRvbXJlYWQuMi4wCgpbcmFuZG9t cmVhZHNlcXdyaXRlczUuMzBdCmRpcmVjdG9yeT0vbW50L3Rlc3QvY29ycmFkbwpydz1yYW5kcmVh ZApzaXplPTJHCnJ1bnRpbWU9MzAKaW9lbmdpbmU9cHN5bmMKZmlsZW5hbWU9cmFuZG9tcmVhZC4y LjAKCltyYW5kb21yZWFkc2Vxd3JpdGVzNS4zMV0KZGlyZWN0b3J5PS9tbnQvdGVzdC9jb3JyYWRv CnJ3PXJhbmRyZWFkCnNpemU9MkcKcnVudGltZT0zMAppb2VuZ2luZT1wc3luYwpmaWxlbmFtZT1y YW5kb21yZWFkLjIuMAoKW3JhbmRvbXJlYWRzZXF3cml0ZXM1LjMyXQpkaXJlY3Rvcnk9L21udC90 ZXN0L2NvcnJhZG8Kcnc9cmFuZHJlYWQKc2l6ZT0yRwpydW50aW1lPTMwCmlvZW5naW5lPXBzeW5j CmZpbGVuYW1lPXJhbmRvbXJlYWQuMi4wCg== --00504502d531882125046bd9bb22-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/