Skip to content

Commit aaf153a

Browse files
LiangChen77davem330
authored andcommitted
page_pool: halve BIAS_MAX for multiple user references of a fragment
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 <[email protected]> Reviewed-by: Yunsheng Lin <[email protected]> Reviewed-by: Mina Almasry <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 66fe896 commit aaf153a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/page_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define DEFER_TIME (msecs_to_jiffies(1000))
2929
#define DEFER_WARN_INTERVAL (60 * HZ)
3030

31-
#define BIAS_MAX LONG_MAX
31+
#define BIAS_MAX (LONG_MAX >> 1)
3232

3333
#ifdef CONFIG_PAGE_POOL_STATS
3434
/* alloc_stat_inc is intended to be used in softirq context */

0 commit comments

Comments
 (0)