path: root/sys/sys/bio.h
diff options
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-02-11 22:30:26 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-02-11 22:30:26 +0000
commitf0e185d7051bd2069c813a483559e3c7500e6b5e (patch)
treeff5a9b210440d57228ccee0a9f33e9dea14809de /sys/sys/bio.h
parent55b84e8a549eb948356bcd298c66c2b7bc9311c4 (diff)
Implement a bio-taskqueue to reduce number of context switches in
disk I/O processing. The intent is that the disk driver in its hardware interrupt routine will simply schedule the bio on the task queue with a routine to finish off whatever needs done. The g_up thread will then schedule this routine, the likely outcome of which is a biodone() which queues the bio on g_up's regular queue where it will be picked up and processed. Compared to the using the regular taskqueue, this saves one contextswitch. Change our scheduling of the g_up and g_down queues to be water-tight, at the cost of breaking the userland regression test-shims. Input and ideas from: scottl
Notes: svn path=/head/; revision=110736
Diffstat (limited to 'sys/sys/bio.h')
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index 31695935e8be..a923a783845d 100644
--- a/sys/sys/bio.h
+++ b/sys/sys/bio.h
@@ -45,6 +45,10 @@
#include <sys/queue.h>
struct disk;
+struct bio;
+typedef void bio_task_t(struct bio *, void *);
* The bio structure describes an I/O operation in the kernel.
@@ -75,6 +79,9 @@ struct bio {
struct bio *bio_parent; /* Pointer to parent */
struct bintime bio_t0; /* Time request started */
+ bio_task_t *bio_task; /* Task_queue handler */
+ void *bio_task_arg; /* Argument to above */
/* XXX: these go away when bio chaining is introduced */
daddr_t bio_pblkno; /* physical block number */
@@ -133,6 +140,8 @@ void bioq_disksort(struct bio_queue_head *ap, struct bio *bp);
void bioq_init(struct bio_queue_head *head);
void bioq_remove(struct bio_queue_head *head, struct bio *bp);
+void bio_taskqueue(struct bio *bp, bio_task_t *fund, void *arg);
int physio(dev_t dev, struct uio *uio, int ioflag);
#define physread physio
#define physwrite physio