Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2012 10:22:57 -0800
From:      Artem Belevich <art@freebsd.org>
To:        =?ISO-8859-2?Q?Edward_Tomasz_Napiera=B3a?= <trasz@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Speeding up the loader(8).
Message-ID:  <CAFqOu6ivT34T_RGHxuWZOTk2mCJ29P6wLY3RHt7=S-wH-Y0eYg@mail.gmail.com>
In-Reply-To: <20120123215503.GA64787@geosci>
References:  <20120123215503.GA64787@geosci>

next in thread | previous in thread | raw e-mail | index | archive | help

2012/1/23 Edward Tomasz Napierała <trasz@freebsd.org>:
> Some time ago I've spent some time on trying to speed up loading
> modules by the loader(8).  Result 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
>   reasonably sized (up to 64kB, IIRC) requests into smaller ones.
>
> 2. The code in biosdisk.c rereads the partition table and probably
>   some filesystem metadata every time a file gets opened, i.e.
>   for every module.  These reads bypass the bcache.
>
> 3. The code in bcache.c doesn't really implement an LRU - it implements
>   'least recently added' algorithm, i.e. a kind of queue.  Not that
>   it matters much, since it flushes the elements two seconds after
>   caching them anyway.  I replaced it with Least Frequently Used.
>   LRU didn't behave well, as it tended to replace metadata with data
>   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.  I 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?  Me 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFqOu6ivT34T_RGHxuWZOTk2mCJ29P6wLY3RHt7=S-wH-Y0eYg>