diff options
author | Robert Wing <rew@FreeBSD.org> | 2021-12-12 21:39:40 +0000 |
---|---|---|
committer | Robert Wing <rew@FreeBSD.org> | 2022-02-17 21:35:19 +0000 |
commit | d3cc82c9b7aa08ee3643dfd39c6c51250844cdc8 (patch) | |
tree | c7f39085eba6b2ff3b87b491186515e445d88e0c | |
parent | 0d27ad33a44c2c580be5c9eb987428f821a2a1ec (diff) | |
download | src-d3cc82c9b7aa08ee3643dfd39c6c51250844cdc8.tar.gz src-d3cc82c9b7aa08ee3643dfd39c6c51250844cdc8.zip |
bhyve: set EV_CLEAR for EVFILT_VNODE mevents
When an EVFILT_VNODE filter event is triggered, reset it.
This fixes the issue where a virtio-blk resize event would cause the
mevent thread to consume 100% of the cpu.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33326
(cherry picked from commit 0b29683b32df0233a85f597836e61cc6432a3e4f)
-rw-r--r-- | usr.sbin/bhyve/mevent.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/mevent.c b/usr.sbin/bhyve/mevent.c index 0c5351cd31a9..e12a46ac9312 100644 --- a/usr.sbin/bhyve/mevent.c +++ b/usr.sbin/bhyve/mevent.c @@ -175,7 +175,14 @@ mevent_kq_filter(struct mevent *mevp) static int mevent_kq_flags(struct mevent *mevp) { - return (mevp->me_state); + int retval; + + retval = mevp->me_state; + + if (mevp->me_type == EVF_VNODE) + retval |= EV_CLEAR; + + return (retval); } static int |