Re: [PATCH v2] virtio: use shadow_avail_idx while checking number of heads

2023-10-07 Thread Jason Wang
On Wed, Sep 27, 2023 at 9:51 PM Ilya Maximets wrote: > > We do not need the most up to date number of heads, we only want to > know if there is at least one. > > Use shadow variable as long as it is not equal to the last available > index checked. This avoids expensive qatomic dereference of the

Re: [PATCH v2] virtio: use shadow_avail_idx while checking number of heads

2023-09-27 Thread Stefan Hajnoczi
On Wed, 27 Sept 2023 at 09:52, Ilya Maximets wrote: > > We do not need the most up to date number of heads, we only want to > know if there is at least one. > > Use shadow variable as long as it is not equal to the last available > index checked. This avoids expensive qatomic dereference of the >

[PATCH v2] virtio: use shadow_avail_idx while checking number of heads

2023-09-27 Thread Ilya Maximets
We do not need the most up to date number of heads, we only want to know if there is at least one. Use shadow variable as long as it is not equal to the last available index checked. This avoids expensive qatomic dereference of the RCU-protected memory region cache as well as the memory access it