From owner-freebsd-fs@FreeBSD.ORG Thu Dec 31 16:13:24 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF021065679 for ; Thu, 31 Dec 2009 16:13:24 +0000 (UTC) (envelope-from mickael.maillot@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 839D68FC1A for ; Thu, 31 Dec 2009 16:13:24 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 4so3342894eyf.9 for ; Thu, 31 Dec 2009 08:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=4gGeHh1Jkl1EqLkFVKWd2p46lsuWibmQ4iZiDWJtp44=; b=NXGAhpLg0/5pjXXMkh8kECxsKofSRSo+Izddi+dZP4ZPDVzASKdZID8aZv9YEgyvZf nMbo59QHjfWC/ICwtbxYyLn8lKGnJhLd4QVRkenGiM4YPVcp8oo5mNWJO1aP6unU3A6W zo1g0oNsUMaTPbwXHdkl1YPg9EJag77J6yZ8w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=B/JFf410mAaGL3yQIH6ydAOpNeEeXEClfsj0IXxZXC3CU70QYzCDDA2ZIFHAwWvCOv BcW8JfhRsz1y25fSiO6d75lspB8rAvH8njPSyKbLz9sdGTc4IgDYjxHRat/MAsfRVjGP 3KttWaNNsS+iG3nAQjQupzg57nlJKEOXv73WA= MIME-Version: 1.0 Received: by 10.216.85.209 with SMTP id u59mr7297526wee.109.1262275995097; Thu, 31 Dec 2009 08:13:15 -0800 (PST) Date: Thu, 31 Dec 2009 17:13:15 +0100 Message-ID: From: =?ISO-8859-1?Q?Micka=EBl_Maillot?= To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: ZFS prefetch problem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 16:13:25 -0000 this bug is referenced: http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6859997 and a good description can be found here: http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6861397 and a long thread on zfs-discuss http://mail.opensolaris.org/pipermail/zfs-discuss/2009-July/029710.html i use bob friesenhahn's script to test (with little mod) http://www.simplesystems.org/users/bfriesen/zfs-discuss/zfs-cache-test.ksh so i test on my hardware for reading 3000 8M files without prefetch: no problem initial real 7m49.039s user 0m2.931s sys 0m22.574s second real 7m48.080s user 0m2.858s sys 0m32.559s with prefetch enable: initial real 2m55.163s user 0m2.244s sys 0m10.072s second real 7m37.522s user 0m2.367s sys 0m10.565s ok i hit the same bug. it was fix by this commit: http://hg.intevation.org/mirrors/opensolaris.org/onnv-gate/rev/0e96dd3b905a which add kstats for prefetch and a bug in rollback (not for us) the only modif for the prefetch + arc problem is resolv by: --- dmu_zfetch.c.orig 2009-12-31 15:46:15.211700719 +0100 +++ dmu_zfetch.c 2009-12-31 15:46:42.915461251 +0100 @@ -323,7 +323,8 @@ * we will read "len" blocks before "striding". */ if (zh->zst_offset >= zs->zst_offset && - zh->zst_offset < zs->zst_offset + zs->zst_len) { + zh->zst_offset < zs->zst_offset + zs->zst_len && + prefetched) { /* already fetched */ rc = 1; goto out; with this patch i have: initial real 2m57.614s user 0m2.228s sys 0m10.054s second real 2m45.403s user 0m2.445s sys 0m9.726s third real 2m16.381s user 0m2.152s sys 0m9.136s looks good. tested on 8-STABLE amd64, with/without log/cache ssd. (but not with zil_disable)