Skip to content

Commit

Permalink
Drivers: hv: util: Make hv_poll_channel() a little more efficient
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed May 18, 2017
1 parent 48f4ccd commit 1e052a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/hv/hyperv_vmbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1e052a1

Please sign in to comment.