Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbZI1PfA (ORCPT ); Mon, 28 Sep 2009 11:35:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752377AbZI1PfA (ORCPT ); Mon, 28 Sep 2009 11:35:00 -0400 Received: from an-out-0708.google.com ([209.85.132.251]:16728 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751473AbZI1Pe6 (ORCPT ); Mon, 28 Sep 2009 11:34:58 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=qvFn2/ZJUyfQ0ePwIzslYUKBJM9i5aYyF7LMKLsNwq3fGL81KWGhTOm4mnxMqt8B9S fF921d1pQVAag4+PEW+/5g/sshrD7kdnIfPInKCibtJEXhWUd07a8CWtMKpjIodh89oJ SSujt2VjaSwP/jVNXp0bm4OeSSeHNmhoDFzjc= MIME-Version: 1.0 In-Reply-To: <20090928145655.GB8192@redhat.com> References: <1253820332-10246-1-git-send-email-vgoyal@redhat.com> <4ABC28DE.7050809@datenparkplatz.de> <20090925202636.GC15007@redhat.com> <4e5e476b0909271000u69d79346s27cccad219e49902@mail.gmail.com> <20090928145655.GB8192@redhat.com> Date: Mon, 28 Sep 2009 17:35:02 +0200 Message-ID: <4e5e476b0909280835w3410d58aod93a29d1dcda8909@mail.gmail.com> Subject: Re: IO scheduler based IO controller V10 From: Corrado Zoccolo To: Vivek Goyal Cc: Ulrich Lukas , linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, dm-devel@redhat.com, nauman@google.com, dpshah@google.com, lizf@cn.fujitsu.com, mikew@google.com, fchecconi@gmail.com, paolo.valente@unimore.it, ryov@valinux.co.jp, fernando@oss.ntt.co.jp, jmoyer@redhat.com, dhaval@linux.vnet.ibm.com, balbir@linux.vnet.ibm.com, righi.andrea@gmail.com, m-ikeda@ds.jp.nec.com, agk@redhat.com, akpm@linux-foundation.org, peterz@infradead.org, jmarchan@redhat.com, torvalds@linux-foundation.org, mingo@elte.hu, riel@redhat.com, jens.axboe@oracle.com, Tobias Oetiker Content-Type: multipart/mixed; boundary=0016e6d386fe8db9340474a50ac1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 38455 Lines: 597 --0016e6d386fe8db9340474a50ac1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 28, 2009 at 4:56 PM, Vivek Goyal wrote: > On Sun, Sep 27, 2009 at 07:00:08PM +0200, Corrado Zoccolo wrote: >> Hi Vivek, >> On Fri, Sep 25, 2009 at 10:26 PM, Vivek Goyal wrote: >> > On Fri, Sep 25, 2009 at 04:20:14AM +0200, Ulrich Lukas wrote: >> >> Vivek Goyal wrote: >> >> > Notes: >> >> > - With vanilla CFQ, random writers can overwhelm a random reader. >> >> > =C2=A0 Bring down its throughput and bump up latencies significantl= y. >> >> >> >> >> >> IIRC, with vanilla CFQ, sequential writing can overwhelm random reade= rs, >> >> too. >> >> >> >> I'm basing this assumption on the observations I made on both OpenSus= e >> >> 11.1 and Ubuntu 9.10 alpha6 which I described in my posting on LKML >> >> titled: "Poor desktop responsiveness with background I/O-operations" = of >> >> 2009-09-20. >> >> (Message ID: 4AB59CBB.8090907@datenparkplatz.de) >> >> >> >> >> >> Thus, I'm posting this to show that your work is greatly appreciated, >> >> given the rather disappointig status quo of Linux's fairness when it >> >> comes to disk IO time. >> >> >> >> I hope that your efforts lead to a change in performance of current >> >> userland applications, the sooner, the better. >> >> >> > [Please don't remove people from original CC list. I am putting them b= ack.] >> > >> > Hi Ulrich, >> > >> > I quicky went through that mail thread and I tried following on my >> > desktop. >> > >> > ########################################## >> > dd if=3D/home/vgoyal/4G-file of=3D/dev/null & >> > sleep 5 >> > time firefox >> > # close firefox once gui pops up. >> > ########################################## >> > >> > It was taking close to 1 minute 30 seconds to launch firefox and dd go= t >> > following. >> > >> > 4294967296 bytes (4.3 GB) copied, 100.602 s, 42.7 MB/s >> > >> > (Results do vary across runs, especially if system is booted fresh. Do= n't >> > =C2=A0know why...). >> > >> > >> > Then I tried putting both the applications in separate groups and assi= gn >> > them weights 200 each. >> > >> > ########################################## >> > dd if=3D/home/vgoyal/4G-file of=3D/dev/null & >> > echo $! > /cgroup/io/test1/tasks >> > sleep 5 >> > echo $$ > /cgroup/io/test2/tasks >> > time firefox >> > # close firefox once gui pops up. >> > ########################################## >> > >> > Now I firefox pops up in 27 seconds. So it cut down the time by 2/3. >> > >> > 4294967296 bytes (4.3 GB) copied, 84.6138 s, 50.8 MB/s >> > >> > Notice that throughput of dd also improved. >> > >> > I ran the block trace and noticed in many a cases firefox threads >> > immediately preempted the "dd". Probably because it was a file system >> > request. So in this case latency will arise from seek time. >> > >> > In some other cases, threads had to wait for up to 100ms because dd wa= s >> > not preempted. In this case latency will arise both from waiting on qu= eue >> > as well as seek time. >> >> I think cfq should already be doing something similar, i.e. giving >> 100ms slices to firefox, that alternate with dd, unless: >> * firefox is too seeky (in this case, the idle window will be too small) >> * firefox has too much think time. >> > Hi Vivek, > Hi Corrado, > > "firefox" is the shell script to setup the environment and launch the > broser. It seems to be a group of threads. Some of them run in parallel > and some of these seems to be running one after the other (once previous > process or threads finished). Ok. > >> To rule out the first case, what happens if you run the test with your >> "fairness for seeky processes" patch? > > I applied that patch and it helps a lot. > > http://lwn.net/Articles/341032/ > > With above patchset applied, and fairness=3D1, firefox pops up in 27-28 s= econds. Great. Can you try the attached patch (on top of 2.6.31)? It implements the alternative approach we discussed privately in july, and it addresses the possible latency increase that could happen with your patch. To summarize for everyone, we separate sync sequential queues, sync seeky queues and async queues in three separate RR strucutres, and alternate servicing requests between them. When servicing seeky queues (the ones that are usually penalized by cfq, for which no fairness is usually provided), we do not idle between them, but we do idle for the last queue (the idle can be exited when any seeky queue has requests). This allows us to allocate disk time globally for all seeky processes, and to reduce seeky processes latencies. I tested with 'konsole -e exit', while doing a sequential write with dd, and the start up time reduced from 37s to 7s, on an old laptop disk. Thanks, Corrado > >> To rule out the first case, what happens if you run the test with your >> "fairness for seeky processes" patch? > > I applied that patch and it helps a lot. > > http://lwn.net/Articles/341032/ > > With above patchset applied, and fairness=3D1, firefox pops up in 27-28 > seconds. > > So it looks like if we don't disable idle window for seeky processes on > hardware supporting command queuing, it helps in this particular case. > > Thanks > Vivek > --0016e6d386fe8db9340474a50ac1 Content-Type: application/octet-stream; name="cfq.patch" Content-Disposition: attachment; filename="cfq.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g05bx0jl0 ZGlmZiAtLWdpdCBhL2Jsb2NrL2NmcS1pb3NjaGVkLmMgYi9ibG9jay9jZnEtaW9zY2hlZC5jCmlu ZGV4IGZkNzA4MGUuLjA2NGY0ZmIgMTAwNjQ0Ci0tLSBhL2Jsb2NrL2NmcS1pb3NjaGVkLmMKKysr IGIvYmxvY2svY2ZxLWlvc2NoZWQuYwpAQCAtMjcsNiArMjcsMTIgQEAgc3RhdGljIGNvbnN0IGlu dCBjZnFfc2xpY2Vfc3luYyA9IEhaIC8gMTA7CiBzdGF0aWMgaW50IGNmcV9zbGljZV9hc3luYyA9 IEhaIC8gMjU7CiBzdGF0aWMgY29uc3QgaW50IGNmcV9zbGljZV9hc3luY19ycSA9IDI7CiBzdGF0 aWMgaW50IGNmcV9zbGljZV9pZGxlID0gSFogLyAxMjU7CitzdGF0aWMgaW50IGNmcV90YXJnZXRf bGF0ZW5jeSA9IEhaICogMy8xMDsgLyogMzAwIG1zICovCitzdGF0aWMgaW50IGNmcV9oaXN0X2Rp dmlzb3IgPSA0OworLyoKKyAqIE51bWJlciBvZiB0aW1lcyB0aGF0IG90aGVyIHdvcmtsb2FkcyBj YW4gYmUgc2NoZWR1bGVkIGJlZm9yZSBhc3luYworICovCitzdGF0aWMgY29uc3QgdW5zaWduZWQg aW50IGNmcV9hc3luY19wZW5hbHR5ID0gNDsKIAogLyoKICAqIG9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bHR5KSwKIAlfX0FUVFJfTlVMTAogfTsKIAo= --0016e6d386fe8db9340474a50ac1-- -- 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/