From: Jason Wang Subject: Re: performance bug in virtio net xdp Date: Wed, 6 May 2020 16:37:41 +0800 Message-ID: <7d801479-5572-0031-b306-a735ca4ce0e4@redhat.com> References: <20200506035704-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20200506035704-mutt-send-email-mst@kernel.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: "Michael S. Tsirkin" Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Jesper Dangaard Brouer , Eugenio Perez Martin List-Id: virtualization@lists.linuxfoundation.org On 2020/5/6 =E4=B8=8B=E5=8D=884:08, Michael S. Tsirkin wrote: > So for mergeable bufs, we use ewma machinery to guess the correct buffe= r > size. If we don't guess correctly, XDP has to do aggressive copies. > > Problem is, xdp paths do not update the ewma at all, except > sometimes with XDP_PASS. So whatever we happen to have > before we attach XDP, will mostly stay around. It looks ok to me since we always use PAGE_SIZE when XDP is enabled in=20 get_mergeable_buf_len()? Thanks > > The fix is probably to update ewma unconditionally. >