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

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,

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

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

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

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

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.

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