diff mbox series

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

Message ID 20231211035243.15774-3-liangchen.linux@gmail.com (mailing list archive)
State New
Headers show
Series skbuff: Optimize SKB coalescing for page pool | expand

Commit Message

Liang Chen Dec. 11, 2023, 3:52 a.m. UTC
Referring to patch [1], in order to support multiple users referencing the
same fragment and prevent overflow from pp_ref_count growing, the initial
value of pp_ref_count is halved, leaving room for pp_ref_count to increment
before the page is drained.

[1]
https://lore.kernel.org/all/20211009093724.10539-3-linyunsheng@huawei.com/

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

Comments

Jesper Dangaard Brouer Dec. 11, 2023, 10:12 a.m. UTC | #1
Hi Alex,

For page_pool BIAS stuff I would really appreciate your review please.
-Jesper


On 11/12/2023 04.52, Liang Chen wrote:
> Referring to patch [1], in order to support multiple users referencing the
> same fragment and prevent overflow from pp_ref_count growing, the initial
> value of pp_ref_count is halved, leaving room for pp_ref_count to increment
> before the page is drained.
> 
> [1]
> https://lore.kernel.org/all/20211009093724.10539-3-linyunsheng@huawei.com/
> 
> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> Reviewed-by: Yunsheng Lin <linyunsheng@huawei.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 */
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 */