aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_event.c
diff options
context:
space:
mode:
authorDoug Ambrisko <ambrisko@FreeBSD.org>2005-10-12 17:51:31 +0000
committerDoug Ambrisko <ambrisko@FreeBSD.org>2005-10-12 17:51:31 +0000
commit69cd28dacb8e71cbd62f1f4186f2f1b20f778f85 (patch)
tree75edf3632319de1bc0b81f2f6e11dddc75311bef /sys/kern/kern_event.c
parent7fb8511e348a918bcd9c055b16199902ba9a4baa (diff)
downloadsrc-69cd28dacb8e71cbd62f1f4186f2f1b20f778f85.tar.gz
src-69cd28dacb8e71cbd62f1f4186f2f1b20f778f85.zip
Add in kqueue support to LIO event notification and fix how it handled
notifications when LIO operations completed. These were the problems with LIO event complete notification: - Move all LIO/AIO event notification into one general function so we don't have bugs in different data paths. This unification got rid of several notification bugs one of which if kqueue was used a SIGILL could get sent to the process. - Change the LIO event accounting to count all AIO request that could have been split across the fast path and daemon mode. The prior accounting only kept track of AIO op's in that mode and not the entire list of operations. This could cause a bogus LIO event complete notification to occur when all of the fast path AIO op's completed and not the AIO op's that ended up queued for the daemon. Suggestions from: alc
Notes
Notes: svn path=/head/; revision=151260
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r--sys/kern/kern_event.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 3aa4550243b9..341910162454 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -247,6 +247,7 @@ static struct {
{ &timer_filtops }, /* EVFILT_TIMER */
{ &file_filtops }, /* EVFILT_NETDEV */
{ &fs_filtops }, /* EVFILT_FS */
+ { &null_filtops }, /* EVFILT_LIO */
};
/*
@@ -633,6 +634,8 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
changes = keva;
for (i = 0; i < n; i++) {
kevp = &changes[i];
+ if (!kevp->filter)
+ continue;
kevp->flags &= ~EV_SYSFLAGS;
error = kqueue_register(kq, kevp, td, 1);
if (error) {
@@ -1828,7 +1831,7 @@ knote_attach(struct knote *kn, struct kqueue *kq)
}
/*
- * knote must already have been detatched using the f_detach method.
+ * knote must already have been detached using the f_detach method.
* no lock need to be held, it is assumed that the KN_INFLUX flag is set
* to prevent other removal.
*/
@@ -1850,7 +1853,8 @@ knote_drop(struct knote *kn, struct thread *td)
else
list = &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmask)];
- SLIST_REMOVE(list, kn, knote, kn_link);
+ if (!SLIST_EMPTY(list))
+ SLIST_REMOVE(list, kn, knote, kn_link);
if (kn->kn_status & KN_QUEUED)
knote_dequeue(kn);
KQ_UNLOCK_FLUX(kq);