[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201222145221.711-14-xieyongji@bytedance.com>
Date: Tue, 22 Dec 2020 22:52:21 +0800
From: Xie Yongji <xieyongji@...edance.com>
To: mst@...hat.com, jasowang@...hat.com, stefanha@...hat.com,
sgarzare@...hat.com, parav@...dia.com, akpm@...ux-foundation.org,
rdunlap@...radead.org, willy@...radead.org,
viro@...iv.linux.org.uk, axboe@...nel.dk, bcrl@...ck.org,
corbet@....net
Cc: virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
kvm@...r.kernel.org, linux-aio@...ck.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: [RFC v2 13/13] vduse: Introduce a workqueue for irq injection
This patch introduces a dedicated workqueue for irq injection
so that we are able to do some performance tuning for it.
Signed-off-by: Xie Yongji <xieyongji@...edance.com>
---
drivers/vdpa/vdpa_user/eventfd.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/vdpa_user/eventfd.c b/drivers/vdpa/vdpa_user/eventfd.c
index dbffddb08908..caf7d8d68ac0 100644
--- a/drivers/vdpa/vdpa_user/eventfd.c
+++ b/drivers/vdpa/vdpa_user/eventfd.c
@@ -18,6 +18,7 @@
#include "eventfd.h"
static struct workqueue_struct *vduse_irqfd_cleanup_wq;
+static struct workqueue_struct *vduse_irq_wq;
static void vduse_virqfd_shutdown(struct work_struct *work)
{
@@ -57,7 +58,7 @@ static int vduse_virqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
__poll_t flags = key_to_poll(key);
if (flags & EPOLLIN)
- schedule_work(&virqfd->inject);
+ queue_work(vduse_irq_wq, &virqfd->inject);
if (flags & EPOLLHUP) {
spin_lock(&vq->irq_lock);
@@ -165,11 +166,18 @@ int vduse_virqfd_init(void)
if (!vduse_irqfd_cleanup_wq)
return -ENOMEM;
+ vduse_irq_wq = alloc_workqueue("vduse-irq", WQ_SYSFS | WQ_UNBOUND, 0);
+ if (!vduse_irq_wq) {
+ destroy_workqueue(vduse_irqfd_cleanup_wq);
+ return -ENOMEM;
+ }
+
return 0;
}
void vduse_virqfd_exit(void)
{
+ destroy_workqueue(vduse_irq_wq);
destroy_workqueue(vduse_irqfd_cleanup_wq);
}
--
2.11.0
Powered by blists - more mailing lists