Message ID | 20230119043747.943452-1-wei.fang@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | e38553bdc377e3e7a6caa9dd9770d8b644d8dac3 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: fec: Use page_pool_put_full_page when freeing rx buffers | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net |
netdev/fixes_present | success | Fixes tag present in non-next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Single patches do not need cover letters |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/cc_maintainers | success | CCed 9 of 9 maintainers |
netdev/build_clang | success | Errors and warnings before: 0 this patch: 0 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | Fixes tag looks correct |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/checkpatch | warning | WARNING: line length of 97 exceeds 80 columns |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
On 1/18/2023 8:37 PM, wei.fang@nxp.com wrote: > From: Wei Fang <wei.fang@nxp.com> > > The page_pool_release_page was used when freeing rx buffers, and this > function just unmaps the page (if mapped) and does not recycle the page. > So after hundreds of down/up the eth0, the system will out of memory. > For more details, please refer to the following reproduce steps and > bug logs. To solve this issue and refer to the doc of page pool, the > page_pool_put_full_page should be used to replace page_pool_release_page. > Because this API will try to recycle the page if the page refcnt equal to > 1. After testing 20000 times, the issue can not be reproduced anymore > (about testing 391 times the issue will occur on i.MX8MN-EVK before). I had a look over other users in the kernel and it seems this bug hasn't propagated anywhere that I see. Thanks, for the fix, seems good to me. Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Thu, 19 Jan 2023 12:37:47 +0800 you wrote: > From: Wei Fang <wei.fang@nxp.com> > > The page_pool_release_page was used when freeing rx buffers, and this > function just unmaps the page (if mapped) and does not recycle the page. > So after hundreds of down/up the eth0, the system will out of memory. > For more details, please refer to the following reproduce steps and > bug logs. To solve this issue and refer to the doc of page pool, the > page_pool_put_full_page should be used to replace page_pool_release_page. > Because this API will try to recycle the page if the page refcnt equal to > 1. After testing 20000 times, the issue can not be reproduced anymore > (about testing 391 times the issue will occur on i.MX8MN-EVK before). > > [...] Here is the summary with links: - [net] net: fec: Use page_pool_put_full_page when freeing rx buffers https://git.kernel.org/netdev/net/c/e38553bdc377 You are awesome, thank you!
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 644f3c963730..2341597408d1 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3191,7 +3191,7 @@ static void fec_enet_free_buffers(struct net_device *ndev) for (q = 0; q < fep->num_rx_queues; q++) { rxq = fep->rx_queue[q]; for (i = 0; i < rxq->bd.ring_size; i++) - page_pool_release_page(rxq->page_pool, rxq->rx_skb_info[i].page); + page_pool_put_full_page(rxq->page_pool, rxq->rx_skb_info[i].page, false); for (i = 0; i < XDP_STATS_TOTAL; i++) rxq->stats[i] = 0;