On 8/9/23 04:37, Jason Wang wrote: > On Tue, Aug 8, 2023 at 6:28 AM Ilya Maximets <i.maxim...@ovn.org> wrote: >> >> Lots of virtio functions that are on a hot path in data transmission >> are initializing indirect descriptor cache at the point of stack >> allocation. It's a 112 byte structure that is getting zeroed out on >> each call adding unnecessary overhead. It's going to be correctly >> initialized later via special init function. The only reason to >> actually initialize right away is the ability to safely destruct it. >> However, we only need to destruct it when it was used, i.e. when a >> desc_cache points to it. >> >> Removing these unnecessary stack initializations improves throughput >> of virtio-net devices in terms of 64B packets per second by 6-14 % >> depending on the case. Tested with a proposed af-xdp network backend >> and a dpdk testpmd application in the guest, but should be beneficial >> for other virtio devices as well. >> >> Signed-off-by: Ilya Maximets <i.maxim...@ovn.org> > > Acked-by: Jason Wang <jasow...@redhat.com> > > Btw, we can probably remove MEMORY_REGION_CACHE_INVALID.
Good point. I can include that in the patch. Or just replace it with a function, as Stefan suggested. Best regards, Ilya Maximets.