瀏覽代碼

Drivers: hv: util: Make hv_poll_channel() a little more efficient

The current code unconditionally sends an IPI. If we are running on the
correct CPU and are in interrupt level, we don't need an IPI.
Make this adjustment.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
K. Y. Srinivasan 8 年之前
父節點
當前提交
1e052a16eb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/hv/hyperv_vmbus.h

+ 4 - 0
drivers/hv/hyperv_vmbus.h

@@ -411,6 +411,10 @@ static inline void hv_poll_channel(struct vmbus_channel *channel,
 	if (!channel)
 		return;
 
+	if (in_interrupt() && (channel->target_cpu == smp_processor_id())) {
+		cb(channel);
+		return;
+	}
 	smp_call_function_single(channel->target_cpu, cb, channel, true);
 }