diff mbox series

[net-next,v10,2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment

Message ID 20231214042833.21316-2-liangchen.linux@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series skbuff: Optimize SKB coalescing for page pool | expand

Commit Message

Liang Chen Dec. 14, 2023, 4:28 a.m. UTC
Up to now, we were only subtracting from the number of used page fragments
to figure out when a page could be freed or recycled. A following patch
introduces support for multiple users referencing the same fragment. So
reduce the initial page fragments value to half to avoid overflowing.

Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Mina Almasry <almarsymina@google.com>
---
 net/core/page_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilias Apalodimas Dec. 14, 2023, 6:11 a.m. UTC | #1
On Thu, 14 Dec 2023 at 06:30, Liang Chen <liangchen.linux@gmail.com> wrote:
>
> Up to now, we were only subtracting from the number of used page fragments
> to figure out when a page could be freed or recycled. A following patch
> introduces support for multiple users referencing the same fragment. So
> reduce the initial page fragments value to half to avoid overflowing.
>
> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
> Reviewed-by: Mina Almasry <almarsymina@google.com>
> ---
>  net/core/page_pool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 106220b1f89c..436f7ffea7b4 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -26,7 +26,7 @@
>  #define DEFER_TIME (msecs_to_jiffies(1000))
>  #define DEFER_WARN_INTERVAL (60 * HZ)
>
> -#define BIAS_MAX       LONG_MAX
> +#define BIAS_MAX       (LONG_MAX >> 1)
>
>  #ifdef CONFIG_PAGE_POOL_STATS
>  /* alloc_stat_inc is intended to be used in softirq context */
> --
> 2.31.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Jakub Kicinski Dec. 15, 2023, 3:08 a.m. UTC | #2
On Thu, 14 Dec 2023 12:28:31 +0800 Liang Chen wrote:
> Subject: [PATCH net-next v10 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment

You do have to re-generate / re-number the patches to 1/3, 2/3, 3/3,
otherwise patchwork thinks that there's patch 1/4 missing and doesn't
kick off automation :)
Liang Chen Dec. 15, 2023, 3:17 a.m. UTC | #3
On Fri, Dec 15, 2023 at 11:08 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 14 Dec 2023 12:28:31 +0800 Liang Chen wrote:
> > Subject: [PATCH net-next v10 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment
>
> You do have to re-generate / re-number the patches to 1/3, 2/3, 3/3,
> otherwise patchwork thinks that there's patch 1/4 missing and doesn't
> kick off automation :)
> --

Sure. Thanks for the reminder!

> pw-bot: cr
diff mbox series

Patch

diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 106220b1f89c..436f7ffea7b4 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -26,7 +26,7 @@ 
 #define DEFER_TIME (msecs_to_jiffies(1000))
 #define DEFER_WARN_INTERVAL (60 * HZ)
 
-#define BIAS_MAX	LONG_MAX
+#define BIAS_MAX	(LONG_MAX >> 1)
 
 #ifdef CONFIG_PAGE_POOL_STATS
 /* alloc_stat_inc is intended to be used in softirq context */