Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148085361
D4258.id10441.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
D4258.id10441.diff
View Options
Index: sys/dev/hyperv/utilities/hv_kvp.c
===================================================================
--- sys/dev/hyperv/utilities/hv_kvp.c
+++ sys/dev/hyperv/utilities/hv_kvp.c
@@ -44,6 +44,7 @@
#include <sys/reboot.h>
#include <sys/lock.h>
#include <sys/taskqueue.h>
+#include <sys/selinfo.h>
#include <sys/sysctl.h>
#include <sys/poll.h>
#include <sys/proc.h>
@@ -114,6 +115,8 @@
static struct hv_kvp_msg *hv_kvp_dev_buf;
struct proc *daemon_task;
+static struct selinfo hv_kvp_selinfo;
+
/*
* Global state to track and synchronize multiple
* KVP transaction requests from the host.
@@ -628,6 +631,9 @@
/* Send the msg to user via function deamon_read - setting sema */
sema_post(&kvp_globals.dev_sema);
+
+ /* We should wake up the daemon, in case it's doing poll() */
+ selwakeup(&hv_kvp_selinfo);
}
@@ -940,7 +946,7 @@
* for daemon to read.
*/
static int
-hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td __unused)
+hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td)
{
int revents = 0;
@@ -953,6 +959,9 @@
*/
if (kvp_globals.daemon_busy == true)
revents = POLLIN;
+ else
+ selrecord(td, &hv_kvp_selinfo);
+
mtx_unlock(&kvp_globals.pending_mutex);
return (revents);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 16, 4:13 PM (12 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29726783
Default Alt Text
D4258.id10441.diff (1 KB)
Attached To
Mode
D4258: hyperv: kvp: wake up the daemon if it's sleeping due to poll()
Attached
Detach File
Event Timeline
Log In to Comment