Re: [PATCH v5 RFC 0/6] introduce page_pool_alloc() API

From: Alexander Lobakin
Date: Thu Jun 29 2023 - 10:27:41 EST


From: Yunsheng Lin <linyunsheng@xxxxxxxxxx>
Date: Thu, 29 Jun 2023 20:02:20 +0800

> In [1] & [2] & [3], there are usecases for veth and virtio_net
> to use frag support in page pool to reduce memory usage, and it
> may request different frag size depending on the head/tail
> room space for xdp_frame/shinfo and mtu/packet size. When the
> requested frag size is large enough that a single page can not
> be split into more than one frag, using frag support only have
> performance penalty because of the extra frag count handling
> for frag support.
>
> So this patchset provides a page pool API for the driver to
> allocate memory with least memory utilization and performance
> penalty when it doesn't know the size of memory it need
> beforehand.
>
> 1. https://patchwork.kernel.org/project/netdevbpf/patch/d3ae6bd3537fbce379382ac6a42f67e22f27ece2.1683896626.git.lorenzo@xxxxxxxxxx/
> 2. https://patchwork.kernel.org/project/netdevbpf/patch/20230526054621.18371-3-liangchen.linux@xxxxxxxxx/
> 3. https://github.com/alobakin/linux/tree/iavf-pp-frag

Thanks for sharing the link :D

>
> v5 RFC: add a new page_pool_cache_alloc() API, and other minor
> change as discussed in v4. As there seems to be three
> comsumers that might be made use of the new API, so
> repost it as RFC and CC the relevant authors to see
> if the new API fits their need.

Tested v5 against my latest tree, no regressions, perf is even a bit
better than it was. That also might've come from that net-next pulled
Linus' tree with a good bunch of PRs already merged, or from v4 -> v5
update.

Re consumers, I'm planning to send the RFC series with IAVF as a
consumer on Monday (and a couple generic Page Pool improvements today,
will see).

>
> V4. Fix a typo and add a patch to update document about frag
> API, PAGE_POOL_DMA_USE_PP_FRAG_COUNT is not renamed yet
> as we may need a different thread to discuss that.
>
> V3: Incorporate changes from the disscusion with Alexander,
> mostly the inline wraper, PAGE_POOL_DMA_USE_PP_FRAG_COUNT
> change split to separate patch and comment change.
> V2: Add patch to remove PP_FLAG_PAGE_FRAG flags and mention
> virtio_net usecase in the cover letter.
> V1: Drop RFC tag and page_pool_frag patch.
Thanks,
Olek