From: K. Y. Srinivasan Date: Sun, 30 Apr 2017 23:21:17 +0000 (-0700) Subject: Drivers: hv: util: Make hv_poll_channel() a little more efficient X-Git-Tag: v4.13-rc1~181^2~145 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1e052a16eb2caf6727b594cad0744ccdfddf4254;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6113e915c50e..fa514be7679c 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/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); }