Page MenuHomeFreeBSD

D45215.1782617266.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D45215.1782617266.diff

diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -137,12 +137,16 @@
return (bp);
}
+static int reserved_new_bios = 65536;
+
struct bio *
g_new_bio(void)
{
struct bio *bp;
- bp = uma_zalloc(biozone, M_NOWAIT | M_ZERO);
+ bp = uma_zalloc(biozone, M_NOWAIT | M_ZERO | M_USE_RESERVE);
+ if (__predict_false(NULL == bp))
+ printf("g_new_bio(): failed to allocate\n");
#ifdef KTR
if (KTR_GEOM_ENABLED) {
struct stack st;
@@ -193,7 +197,7 @@
{
struct bio *bp2;
- bp2 = uma_zalloc(biozone, M_NOWAIT | M_ZERO);
+ bp2 = uma_zalloc(biozone, M_NOWAIT | M_ZERO | M_USE_RESERVE);
if (bp2 != NULL) {
bp2->bio_parent = bp;
bp2->bio_cmd = bp->bio_cmd;
@@ -279,6 +283,14 @@
NULL, NULL,
NULL, NULL,
0, 0);
+ /*
+ * XXX the reservation of a uma(9) zone cannot be altered if it is serving
+ * any items.
+ */
+ if (reserved_new_bios > 0) {
+ uma_prealloc(biozone, reserved_new_bios);
+ uma_zone_reserve(biozone, reserved_new_bios);
+ }
}
int
@@ -734,6 +746,9 @@
SYSCTL_INT(_kern_geom, OID_AUTO, inflight_transient_maps, CTLFLAG_RD,
&inflight_transient_maps, 0,
"Current count of the active transient maps");
+SYSCTL_INT(_kern_geom, OID_AUTO, reserved_new_bios, CTLFLAG_RDTUN,
+ &reserved_new_bios, 0,
+ "Number of reserved new bios for non-blocking allocation");
static int
g_io_transient_map_bio(struct bio *bp)

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 28, 3:27 AM (16 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28969308
Default Alt Text
D45215.1782617266.diff (1 KB)

Event Timeline