Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147216715
D3635.id8673.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3635.id8673.diff
View Options
Index: sys/kern/subr_disk.c
===================================================================
--- sys/kern/subr_disk.c
+++ sys/kern/subr_disk.c
@@ -21,8 +21,13 @@
#include <sys/bio.h>
#include <sys/conf.h>
#include <sys/disk.h>
+#include <sys/sysctl.h>
#include <geom/geom_disk.h>
+static int bioq_batchsize = 128;
+SYSCTL_INT(_debug, OID_AUTO, bioq_batchsize, CTLFLAG_RW,
+ &bioq_batchsize, 0, "BIOQ batch size");
+
/*-
* Disk error is the preface to plaintive error messages
* about failing disk transfers. It prints messages of the form
@@ -150,6 +155,7 @@
TAILQ_INIT(&head->queue);
head->last_offset = 0;
head->insert_point = NULL;
+ head->batched = 0;
}
void
@@ -188,6 +194,7 @@
{
TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue);
+ head->batched = 0;
head->insert_point = bp;
head->last_offset = bp->bio_offset;
}
@@ -246,6 +253,16 @@
return;
}
+ /*
+ * Impose a maximum number of passengers in any given
+ * elevator car. This limits the maximum latency for any
+ * given request without signficantly affecting the average.
+ */
+ if (bioq_batchsize > 0 && head->batched > bioq_batchsize) {
+ bioq_insert_tail(head, bp);
+ return;
+ }
+
prev = NULL;
key = bioq_bio_key(head, bp);
cur = TAILQ_FIRST(&head->queue);
@@ -264,4 +281,6 @@
TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue);
else
TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue);
+
+ head->batched++;
}
Index: sys/sys/bio.h
===================================================================
--- sys/sys/bio.h
+++ sys/sys/bio.h
@@ -129,6 +129,7 @@
TAILQ_HEAD(bio_queue, bio) queue;
off_t last_offset;
struct bio *insert_point;
+ int batched;
};
extern struct vm_map *bio_transient_map;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 10, 5:00 AM (7 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29474910
Default Alt Text
D3635.id8673.diff (1 KB)
Attached To
Mode
D3635: Improve outlier latency by implementing batch size for bioq_disksort
Attached
Detach File
Event Timeline
Log In to Comment