OSDN Git Service

Drivers: hv: util: Make hv_poll_channel() a little more efficient
authorK. Y. Srinivasan <kys@microsoft.com>
Sun, 30 Apr 2017 23:21:17 +0000 (16:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 May 2017 14:55:28 +0000 (16:55 +0200)
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>
drivers/hv/hyperv_vmbus.h

index 6113e91..fa514be 100644 (file)
@@ -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);
 }