-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vdev_disk: be smarter about sizing the bio array
With the max segments for the bio now generally much smaller, and varying depending on the device/driver characteristics, the intial array size of 16 is totally inadequate. The main reason for getting this right is so we don't have to throw away all the bios built so far and restart. However there's no particular reason to do it this way; the bios constructed so far are perfectly fine; we just ran out of room to track them. So this commit changes it so if we run out of room in the bio array, instead of throwing away the contents entirely, we just create a larger one and copy the existing bios into it, and keep going. Finally, to decide the right initial size for the bio array, we take a guess at the likely size by dividing the io size by the page size by the max device segments. This is likely right most of the time, and if turns out to not be enough, we simply expand it and keep going. Signed-off-by: Rob Norris <[email protected]> Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc.
- Loading branch information
Showing
1 changed file
with
65 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters