]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
makefs: make msdos creation go fast
authorWarner Losh <imp@FreeBSD.org>
Mon, 13 Mar 2023 20:28:51 +0000 (14:28 -0600)
committerWarner Losh <imp@FreeBSD.org>
Mon, 13 Mar 2023 20:38:36 +0000 (14:38 -0600)
commit370e009188ba90c3290b1479aa06ec98b66e140a
tree178f2fc7728c1baf77c733a3d1bf3e7b02fdddc6
parent35b6e52c30a290e081710b87ff0be21f4941d3f4
makefs: make msdos creation go fast

Add missing brelse(bp). Without it the cache grows and we have a n^2
lookup.  I'm not entirely sure why we read the block before we write it
back out, since the only side effect of that is to allocate memory,
clear the memory, read it in from disk, throw it away with the contents
of the file being written out. We likely should just do a getblk() here
instead, but even with all that, this takes the time it takes to create
a 150MB msdos fs image down from 5 minutes to 30 seconds.

Old: 317.663u 0.685s 5:18.34 100.0% 198+360k 0+19io 1009pf+0w
New: 7.330u 23.841s 0:31.17 100.0% 198+360k 0+250522io 4pf+0w

See code review for how we got this. tl;dr: netbsd move brelse
into bwrite and we picked up msdos code after that, but not the
move. That change should be picked up later.

Sponsored by: Netflix
Reviewed by: emaste
MFC After: 1 day (13.2 is coming fast)
Differential Revision: https://reviews.freebsd.org/D39025
usr.sbin/makefs/msdos/msdosfs_vnops.c