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

2023-09-27 Thread Ilya Maximets
On 9/26/23 00:24, Michael S. Tsirkin wrote: > On Tue, Sep 26, 2023 at 12:13:11AM +0200, Ilya Maximets wrote: >> On 9/25/23 23:24, Michael S. Tsirkin wrote: >>> On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: On 9/25/23 17:38, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at

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

2023-09-25 Thread Michael S. Tsirkin
On Tue, Sep 26, 2023 at 12:13:11AM +0200, Ilya Maximets wrote: > On 9/25/23 23:24, Michael S. Tsirkin wrote: > > On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: > >> On 9/25/23 17:38, Stefan Hajnoczi wrote: > >>> On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: > > On 9

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

2023-09-25 Thread Ilya Maximets
On 9/25/23 23:24, Michael S. Tsirkin wrote: > On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: >> On 9/25/23 17:38, Stefan Hajnoczi wrote: >>> On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: On 9/25/23 17:12, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at 11:02, I

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

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 10:58:05PM +0200, Ilya Maximets wrote: > On 9/25/23 17:38, Stefan Hajnoczi wrote: > > On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: > >> > >> On 9/25/23 17:12, Stefan Hajnoczi wrote: > >>> On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: > > On 9/25/23 1

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

2023-09-25 Thread Ilya Maximets
On 9/25/23 17:38, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: >> >> On 9/25/23 17:12, Stefan Hajnoczi wrote: >>> On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: On 9/25/23 16:23, Stefan Hajnoczi wrote: > On Fri, 25 Aug 2023 at 13:04, Ilya Maximet

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

2023-09-25 Thread Stefan Hajnoczi
On Mon, 25 Sept 2023 at 11:36, Ilya Maximets wrote: > > On 9/25/23 17:12, Stefan Hajnoczi wrote: > > On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: > >> > >> On 9/25/23 16:23, Stefan Hajnoczi wrote: > >>> On Fri, 25 Aug 2023 at 13:04, Ilya Maximets wrote: > > We do not need the mo

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

2023-09-25 Thread Ilya Maximets
On 9/25/23 17:12, Stefan Hajnoczi wrote: > On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: >> >> On 9/25/23 16:23, Stefan Hajnoczi wrote: >>> On Fri, 25 Aug 2023 at 13:04, Ilya Maximets wrote: We do not need the most up to date number of heads, we only want to know if there is

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

2023-09-25 Thread Stefan Hajnoczi
On Mon, 25 Sept 2023 at 11:02, Ilya Maximets wrote: > > On 9/25/23 16:23, Stefan Hajnoczi wrote: > > On Fri, 25 Aug 2023 at 13:04, 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 a

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

2023-09-25 Thread Ilya Maximets
On 9/25/23 16:23, Stefan Hajnoczi wrote: > On Fri, 25 Aug 2023 at 13:04, 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. Th

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

2023-09-25 Thread Stefan Hajnoczi
On Fri, 25 Aug 2023 at 13:04, 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] virtio: use shadow_avail_idx while checking number of heads

2023-09-25 Thread Ilya Maximets
On 8/25/23 19:04, 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 > RCU-protected

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

2023-08-25 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