Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932708AbZDHTTU (ORCPT ); Wed, 8 Apr 2009 15:19:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755703AbZDHTTG (ORCPT ); Wed, 8 Apr 2009 15:19:06 -0400 Received: from mail-ew0-f165.google.com ([209.85.219.165]:44236 "EHLO mail-ew0-f165.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754568AbZDHTTC (ORCPT ); Wed, 8 Apr 2009 15:19:02 -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=vkZ0nt0NGc6iqx0dQMJvdDpr27BPGlLgMh/KYe/9XA5qypjqoL879FQUqI7MEkkYzi g/wAsoLKunQ2oG/iNTtL7x+ONlr+tDTIqv5zhp+sBzPkWQB7rdvwYV7mZfYrydB5jvK6 4Yaru4BV2W5ACbS8K++c0bSWeO7Pcvj8wUH0k= MIME-Version: 1.0 In-Reply-To: <200902071858.40146.jk-lkml@sci.fi> References: <4dcf7d360901301355l7ed26a5aob7ef6d79d9607b6b@mail.gmail.com> <20090204004003.26068f72@werewolf.home> <200902071858.40146.jk-lkml@sci.fi> Date: Wed, 8 Apr 2009 21:18:59 +0200 Message-ID: <4e5e476b0904081218i29871702qc8bacb680c51ec2c@mail.gmail.com> Subject: Re: SSD and IO schedulers From: Corrado Zoccolo To: =?UTF-8?B?Si5BLiBNYWdhbGzDs24=?= , Linux-Kernel Cc: Jan Knutar Content-Type: multipart/mixed; boundary=0016364d2aa7f2fd170467100055 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 17424 Lines: 257 --0016364d2aa7f2fd170467100055 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I found that elevator=3Ddeadline performs much better than noop for writes, and almost as well for reads, and started to wonder how a combination of noop (for read) + deadline (for write) would work in practice (since deadline still doesn't support the automatic ssd detection). I developed a simple hybrid scheduler (see attached), that implements this idea, and it saved 1 s of my boot time compared to all other schedulers (cfq, deadline and noop, each loses on some part of the workload), that is a mixed read write workload, with writes that go mainly to a very slow device (SDHC card, where I mount /var). This proof of concept still doesn't support priorities, but I'm willing to add them at least for read, in which the latency for sync-reads could be improved. Corrado On Sat, Feb 7, 2009 at 6:58 PM, Jan Knutar wrote: > On Wednesday 04 February 2009, J.A. Magall=C3=B3n wrote: > >> Perhaps the reason is that, as the SSD is not so good, it behaves >> more like a rotational drive ;). > > Do any other SSDs except Intel's exist that DON'T behave more like a > rotational drive? I am guessing using something like LogFS would give > the biggest boost on cheap SSDs and all memory cards. > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" i= n > the body of a message to majordomo@vger.kernel.org > More majordomo info at =C2=A0http://vger.kernel.org/majordomo-info.html > Please read the FAQ at =C2=A0http://www.tux.org/lkml/ > --=20 __________________________________________________________________________ dott. Corrado Zoccolo mailto:czoccolo@gmail.com PhD - Department of Computer Science - University of Pisa, Italy -------------------------------------------------------------------------- The self-confidence of a warrior is not the self-confidence of the average man. The average man seeks certainty in the eyes of the onlooker and calls that self-confidence. The warrior seeks impeccability in his own eyes and calls that humbleness. Tales of Power - C. Castaneda --0016364d2aa7f2fd170467100055 Content-Type: text/x-csrc; charset=US-ASCII; name="ssd-iosched.c" Content-Disposition: attachment; filename="ssd-iosched.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ftaed6ef0 LyogLSotIG1vZGU6QzsgdGFiLXdpZHRoOjg7IGMtYmFzaWMtb2Zmc2V0OjggLSotCiAqICBTc2Qg aS9vIHNjaGVkdWxlci4KICoKICogIENvcHlyaWdodCAoQykgMjAwMiBKZW5zIEF4Ym9lIDxheGJv ZUBrZXJuZWwuZGs+CiAqLwojaW5jbHVkZSA8bGludXgva2VybmVsLmg+CiNpbmNsdWRlIDxsaW51 eC9mcy5oPgojaW5jbHVkZSA8bGludX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X2xhdHRlcl9yZXF1ZXN0LAoJCS5lbGV2 YXRvcl9pbml0X2ZuID0JCXNzZF9pbml0X3F1ZXVlLAoJCS5lbGV2YXRvcl9leGl0X2ZuID0JCXNz ZF9leGl0X3F1ZXVlLAoJfSwKCgkuZWxldmF0b3JfYXR0cnMgPSBzc2RfYXR0cnMsCgkuZWxldmF0 b3JfbmFtZSA9ICJzc2QiLAoJLmVsZXZhdG9yX293bmVyID0gVEhJU19NT0RVTEUsCn07CgpzdGF0 aWMgaW50IF9faW5pdCBzc2RfaW5pdCh2b2lkKQp7CgllbHZfcmVnaXN0ZXIoJmlvc2NoZWRfc3Nk KTsKCglyZXR1cm4gMDsKfQoKc3RhdGljIHZvaWQgX19leGl0IHNzZF9leGl0KHZvaWQpCnsKCWVs dl91bnJlZ2lzdGVyKCZpb3NjaGVkX3NzZCk7Cn0KCm1vZHVsZV9pbml0KHNzZF9pbml0KTsKbW9k dWxlX2V4aXQoc3NkX2V4aXQpOwoKTU9EVUxFX0FVVEhPUigiQ29ycmFkbyBab2Njb2xvIik7Ck1P RFVMRV9MSUNFTlNFKCJHUEwiKTsKTU9EVUxFX0RFU0NSSVBUSU9OKCJzc2QgSU8gc2NoZWR1bGVy Iik7Cg== --0016364d2aa7f2fd170467100055-- -- 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/