From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 24 18:47:56 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 CEA2B106564A for ; Tue, 24 Jan 2012 18:47:56 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1D08FC08 for ; Tue, 24 Jan 2012 18:47:56 +0000 (UTC) Received: by ghbg15 with SMTP id g15so691480ghb.13 for ; Tue, 24 Jan 2012 10:47:55 -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=CWhYNMv17xdyX+SfqN1Ondvm5MtUPqwUS5BIPK+ye8Y=; b=Cdcn/Vg4Zy3f+2d7RYHVp6viU7rHsl4Zw0tciNkWMI9MJqJn85tjk15pl01fVvsS00 sYyiQJcpEs/bcDjss1LkCEs5qmWuox+9I0bY1FLrV44G+Zjfe527F4monJE4FxrhqSpy s7A3W/GOUoe2Z4zKb0nrBaFtAaXnmYjcJP7+c= MIME-Version: 1.0 Received: by 10.101.5.16 with SMTP id h16mr6071967ani.48.1327429377863; Tue, 24 Jan 2012 10:22:57 -0800 (PST) Sender: artemb@gmail.com Received: by 10.147.47.6 with HTTP; Tue, 24 Jan 2012 10:22:57 -0800 (PST) In-Reply-To: <20120123215503.GA64787@geosci> References: <20120123215503.GA64787@geosci> Date: Tue, 24 Jan 2012 10:22:57 -0800 X-Google-Sender-Auth: jWd53WFoK0S7aqXBxxa3s5MJJ98 Message-ID: From: Artem Belevich To: =?ISO-8859-2?Q?Edward_Tomasz_Napiera=B3a?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org 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: Tue, 24 Jan 2012 18:47:56 -0000 2012/1/23 Edward Tomasz Napiera=C5=82a : > Some time ago I've spent some time on trying to speed up loading > modules by the loader(8). =C2=A0Result can be found at: > > http://people.freebsd.org/~trasz/fast-loader-3.diff > > This patch solves three issues: > > 1. As it is now, the code in biosdisk.c tries very hard to split > =C2=A0 reasonably sized (up to 64kB, IIRC) requests into smaller ones. > > 2. The code in biosdisk.c rereads the partition table and probably > =C2=A0 some filesystem metadata every time a file gets opened, i.e. > =C2=A0 for every module. =C2=A0These reads bypass the bcache. > > 3. The code in bcache.c doesn't really implement an LRU - it implements > =C2=A0 'least recently added' algorithm, i.e. a kind of queue. =C2=A0Not = that > =C2=A0 it matters much, since it flushes the elements two seconds after > =C2=A0 caching them anyway. =C2=A0I replaced it with Least Frequently Use= d. > =C2=A0 LRU didn't behave well, as it tended to replace metadata with data > =C2=A0 used only once. 4. it flushes cache on access to a different drive which means that cache does not help on multi-disk ZFS setups. I've posted a patch some time back. See http://lists.freebsd.org/pipermail/freebsd-fs/2011-September/012527.html Feel free to combine the changes. --Artem > > In my tests under VMWare Fusion, this cut the modules loading time > by half. =C2=A0I don't intend to commit the patch as-is - the first part > looks dangerous (the splitting was probably done for a reason), > the second is hackish, and the third doesn't improve anything by itself. > I'm working on something else at a moment; feel free to pick this up. > > -- > If you cut off my head, what would I say? =C2=A0Me and my head, or me and= my body? > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= "