From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 26 18:22:03 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCE0C106566B; Thu, 26 Jan 2012 18:22:03 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8288FC17; Thu, 26 Jan 2012 18:22:02 +0000 (UTC) Received: by yenq3 with SMTP id q3so434533yen.13 for ; Thu, 26 Jan 2012 10:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HvQiEYb5VUbFo8FRd80CI1OmXHIITsiDOenuuffxbYo=; b=N/BxO2LZmqlVXttKx3mu3VBOqe29TP0pLYM653XXbSHm2LPUmHiHyHxCByZstX6Wm8 0w0Yv1GB3QTW7fKHz5P9h2yOBqEDRb0dbu/5yk/2ZTyGhOM8729QmfRrX/p6AFVPtJZV HkuuctPNu+CQTK/ch6nau0yJd/7xrcgG00qMQ= MIME-Version: 1.0 Received: by 10.236.80.71 with SMTP id j47mr5088259yhe.28.1327602122595; Thu, 26 Jan 2012 10:22:02 -0800 (PST) Sender: artemb@gmail.com Received: by 10.147.47.6 with HTTP; Thu, 26 Jan 2012 10:22:02 -0800 (PST) In-Reply-To: <201201260954.23179.jhb@freebsd.org> References: <20120123215503.GA64787@geosci> <201201260954.23179.jhb@freebsd.org> Date: Thu, 26 Jan 2012 10:22:02 -0800 X-Google-Sender-Auth: Jy7ekaxEtNROqktEsKfoYhP6eOs Message-ID: From: Artem Belevich To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, =?ISO-8859-2?Q?Edward_Tomasz_Napiera=B3a?= Subject: Re: Speeding up the loader(8). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:22:03 -0000 On Thu, Jan 26, 2012 at 6:54 AM, John Baldwin wrote: >> > 3. The code in bcache.c doesn't really implement an LRU - it implement= s >> > =A0 'least recently added' algorithm, i.e. a kind of queue. =A0Not tha= t >> > =A0 it matters much, since it flushes the elements two seconds after >> > =A0 caching them anyway. =A0I replaced it with Least Frequently Used. >> > =A0 LRU didn't behave well, as it tended to replace metadata with data >> > =A0 used only once. > > These sound reasonable, though I suspect they are in part due to dealing = with > floppies where the user can swap out of the disk and we have no way of > noticing otherwise. =A0However, we could possibly adjust some behavior to= cache > the bits if the disk is not a floppy drive. > >> 4. it flushes cache on access to a different drive which means that >> cache does not help on multi-disk ZFS setups. > > I believe this is also necessary to deal with floppies and the fact that = you > don't have a reliable way of knowing if a floppy has changed. Are floppies still relevant? When I attempted to address your concern about floppies that you raised when I've sent my patch, I've discovered that there's no floppy connector on any of the computers/motherboards that I have. Few years back I was amused by an Intel motherboard that came with a floppy disk with RAID drivers on it, but which had no floppy connector on the motherboard. In any case, it's easy enough to enforce old behavior for floppy drives. I will make required changes but I will not be able to test it due to lack of floppy drives. --Artem