mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
vmbus: add prefetch to ring buffer iterator
When iterating over incoming ring elements from the host, prefetch the next descriptor so that it is cache hot. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
03bad714a1
commit
15e1674de7
1 changed files with 6 additions and 1 deletions
|
|
@ -357,11 +357,16 @@ static u32 hv_pkt_iter_avail(const struct hv_ring_buffer_info *rbi)
|
|||
struct vmpacket_descriptor *hv_pkt_iter_first(struct vmbus_channel *channel)
|
||||
{
|
||||
struct hv_ring_buffer_info *rbi = &channel->inbound;
|
||||
struct vmpacket_descriptor *desc;
|
||||
|
||||
if (hv_pkt_iter_avail(rbi) < sizeof(struct vmpacket_descriptor))
|
||||
return NULL;
|
||||
|
||||
return hv_get_ring_buffer(rbi) + rbi->priv_read_index;
|
||||
desc = hv_get_ring_buffer(rbi) + rbi->priv_read_index;
|
||||
if (desc)
|
||||
prefetch((char *)desc + (desc->len8 << 3));
|
||||
|
||||
return desc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hv_pkt_iter_first);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue