Skip to content

Commit

Permalink
page_pool: halve BIAS_MAX for multiple user references of a fragment
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Liang Chen authored and David S. Miller committed Dec 17, 2023
1 parent 66fe896 commit aaf153a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/page_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 */
Expand Down

0 comments on commit aaf153a

Please sign in to comment.