summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2024-03-16 03:47:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-11 13:49:10 +0300
commitabe067dc3a662eef7d5cddbbc41ed50a0b68b0af (patch)
tree5b8c3c1a2e9c3f36c028a36485cf4509400457b9 /include
parentf5bb72196f4905f8c5470f2d9f26302c8616e2b6 (diff)
downloadlinux-abe067dc3a662eef7d5cddbbc41ed50a0b68b0af.tar.xz
vhost_task: Handle SIGKILL by flushing work and exiting
[ Upstream commit db5247d9bf5c6ade9fd70b4e4897441e0269b233 ] Instead of lingering until the device is closed, this has us handle SIGKILL by: 1. marking the worker as killed so we no longer try to use it with new virtqueues and new flush operations. 2. setting the virtqueue to worker mapping so no new works are queued. 3. running all the exiting works. Suggested-by: Edward Adam Davis <eadavis@qq.com> Reported-and-tested-by: syzbot+98edc2df894917b3431f@syzkaller.appspotmail.com Message-Id: <tencent_546DA49414E876EEBECF2C78D26D242EE50A@qq.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Message-Id: <20240316004707.45557-9-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched/vhost_task.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sched/vhost_task.h b/include/linux/sched/vhost_task.h
index 837a23624a66..3612de6ea1c5 100644
--- a/include/linux/sched/vhost_task.h
+++ b/include/linux/sched/vhost_task.h
@@ -5,7 +5,8 @@
struct vhost_task;
-struct vhost_task *vhost_task_create(bool (*fn)(void *), void *arg,
+struct vhost_task *vhost_task_create(bool (*fn)(void *),
+ void (*handle_kill)(void *), void *arg,
const char *name);
void vhost_task_start(struct vhost_task *vtsk);
void vhost_task_stop(struct vhost_task *vtsk);