summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-09-29 16:47:56 +0000
committerae <ae@FreeBSD.org>2012-09-29 16:47:56 +0000
commit75dfd50beb9ad0d46f0492739cbccf5795eb36a2 (patch)
tree403dd8dac6f6bc3959207afde75dad0ebb383086 /sys/boot/uboot
parenta7f869fbc12c7a8560ce1231243042ee05c6b86a (diff)
downloadFreeBSD-src-75dfd50beb9ad0d46f0492739cbccf5795eb36a2.zip
FreeBSD-src-75dfd50beb9ad0d46f0492739cbccf5795eb36a2.tar.gz
Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file. This leads to reading partition table metadata for each call. To reduce the number of disk I/O we have a simple block cache, but it is very dumb and more than half of I/O operations related to reading metadata, misses this cache. Introduce new cache layer to resolve this problem. It is independent and doesn't need initialization like bcache, and will work by default for all loaders which use the new DISK API. A successful disk_open() call to each new disk or partition produces new entry in the cache. Even more, when disk was already open, now opening of any nested partitions does not require reading top level partition table. So, if without this cache, partition table metadata was read around 20-50 times during boot, now it reads only once. This affects the booting from GPT and MBR from the UFS.
Diffstat (limited to 'sys/boot/uboot')
-rw-r--r--sys/boot/uboot/lib/disk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/boot/uboot/lib/disk.c b/sys/boot/uboot/lib/disk.c
index 13f913a..5dc9a5a 100644
--- a/sys/boot/uboot/lib/disk.c
+++ b/sys/boot/uboot/lib/disk.c
@@ -142,6 +142,7 @@ stor_cleanup(void)
for (i = 0; i < stor_info_no; i++)
if (stor_info[i].opened > 0)
ub_dev_close(stor_info[i].handle);
+ disk_cleanup(&uboot_storage);
}
static int
OpenPOWER on IntegriCloud