Re: [PATCH net-next] avoid fragmenting page memory with netdev_alloc_cache

From: Ronak Doshi
Date: Wed Feb 24 2021 - 14:33:26 EST



On 2/11/21, 4:18 PM, "Ronak Doshi" <doshir@xxxxxxxxxx> wrote:
> From: Todd Sabin <tsabin@xxxxxxxxxx>
>
> Linux network stack uses an allocation page cache for skbs. The
> purpose is to reduce the number of page allocations that it needs to
> make, and it works by allocating a group of pages, and then
> sub-allocating skb memory from them. When all skbs referencing the
> shared pages are freed, then the block of pages is finally freed.
>
> When these skbs are all freed close together in time, this works fine.
> However, what can happen is that there are multiple nics (or multiple
> rx-queues in a single nic), and the skbs are allocated to fill the rx
> ring(s). If some nics or queues are far more active than others, the
> entries in the less busy nic/queue may end up referencing a page
> block, while all of the other packets that referenced that block of
> pages are freed.
>
> The result of this is that the memory used by an appliance for its rx
> rings can slowly grow to be much greater than it was originally.
>
> This patch fixes that by giving each vmxnet3 device a per-rx-queue page
> cache.
>
> Signed-off-by: Todd Sabin <tsabin@xxxxxxxxxx>
> Signed-off-by: Ronak Doshi <doshir@xxxxxxxxxx>
> ---
> drivers/net/vmxnet3/vmxnet3_drv.c | 30 ++++++++++++++++++++++++------
> drivers/net/vmxnet3/vmxnet3_int.h | 2 ++
> include/linux/skbuff.h | 2 ++
> net/core/skbuff.c | 21 +++++++++++++++------
> 4 files changed, 43 insertions(+), 12 deletions(-)

Any update on this patch?

Thanks,
Ronak