aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2015-03-27 12:10:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-03 10:18:02 -0400
commitaadc3780f31865edc84c587ab718a33a8eeeb09d (patch)
treee5e5e32ec37ebdc2b57e66beeb71700fe71f5433
parentd43e2fe7da320310834467a3fd87a10adb25a221 (diff)
hv: remove the per-channel workqueue
It's not necessary any longer, since we can safely run the blocking message handlers in vmbus_connection.work_queue now. Signed-off-by: Dexuan Cui <decui@microsoft.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hv/channel_mgmt.c30
-rw-r--r--include/linux/hyperv.h3
2 files changed, 1 insertions, 32 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index d69864d4a4d7..0eeb1b3bc048 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -147,43 +147,15 @@ static struct vmbus_channel *alloc_channel(void)
147 INIT_LIST_HEAD(&channel->sc_list); 147 INIT_LIST_HEAD(&channel->sc_list);
148 INIT_LIST_HEAD(&channel->percpu_list); 148 INIT_LIST_HEAD(&channel->percpu_list);
149 149
150 channel->controlwq = alloc_workqueue("hv_vmbus_ctl/%d", WQ_MEM_RECLAIM,
151 1, channel->id);
152 if (!channel->controlwq) {
153 kfree(channel);
154 return NULL;
155 }
156
157 return channel; 150 return channel;
158} 151}
159 152
160/* 153/*
161 * release_hannel - Release the vmbus channel object itself
162 */
163static void release_channel(struct work_struct *work)
164{
165 struct vmbus_channel *channel = container_of(work,
166 struct vmbus_channel,
167 work);
168
169 destroy_workqueue(channel->controlwq);
170
171 kfree(channel);
172}
173
174/*
175 * free_channel - Release the resources used by the vmbus channel object 154 * free_channel - Release the resources used by the vmbus channel object
176 */ 155 */
177static void free_channel(struct vmbus_channel *channel) 156static void free_channel(struct vmbus_channel *channel)
178{ 157{
179 158 kfree(channel);
180 /*
181 * We have to release the channel's workqueue/thread in the vmbus's
182 * workqueue/thread context
183 * ie we can't destroy ourselves.
184 */
185 INIT_WORK(&channel->work, release_channel);
186 queue_work(vmbus_connection.work_queue, &channel->work);
187} 159}
188 160
189static void percpu_channel_enq(void *arg) 161static void percpu_channel_enq(void *arg)
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 80e444bfc9dc..902c37aef67e 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -653,8 +653,6 @@ struct vmbus_channel {
653 653
654 struct hv_device *device_obj; 654 struct hv_device *device_obj;
655 655
656 struct work_struct work;
657
658 enum vmbus_channel_state state; 656 enum vmbus_channel_state state;
659 657
660 struct vmbus_channel_offer_channel offermsg; 658 struct vmbus_channel_offer_channel offermsg;
@@ -675,7 +673,6 @@ struct vmbus_channel {
675 struct hv_ring_buffer_info outbound; /* send to parent */ 673 struct hv_ring_buffer_info outbound; /* send to parent */
676 struct hv_ring_buffer_info inbound; /* receive from parent */ 674 struct hv_ring_buffer_info inbound; /* receive from parent */
677 spinlock_t inbound_lock; 675 spinlock_t inbound_lock;
678 struct workqueue_struct *controlwq;
679 676
680 struct vmbus_close_msg close_msg; 677 struct vmbus_close_msg close_msg;
681 678