Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
enum { | enum { | ||||
MLX5_BLKS_FOR_RECLAIM_PAGES = 12 | MLX5_BLKS_FOR_RECLAIM_PAGES = 12 | ||||
}; | }; | ||||
s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev) | s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev) | ||||
{ | { | ||||
int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | ||||
s64 prevpages = 0; | s64 prevpages = 0; | ||||
s64 npages = 0; | s64 npages = 0; | ||||
while (!time_after(jiffies, end)) { | while (!time_after(jiffies, end)) { | ||||
/* exclude own function, VFs only */ | /* exclude own function, VFs only */ | ||||
npages = dev->priv.fw_pages - dev->priv.pages_per_func[0]; | npages = dev->priv.fw_pages - dev->priv.pages_per_func[0]; | ||||
if (!npages) | if (!npages) | ||||
break; | break; | ||||
Show All 21 Lines | ret = (sizeof(lay->out) + MLX5_BLKS_FOR_RECLAIM_PAGES * sizeof(block->data) - | ||||
MLX5_ST_SZ_BYTES(manage_pages_out)) / | MLX5_ST_SZ_BYTES(manage_pages_out)) / | ||||
MLX5_FLD_SZ_BYTES(manage_pages_out, pas[0]); | MLX5_FLD_SZ_BYTES(manage_pages_out, pas[0]); | ||||
return ret; | return ret; | ||||
} | } | ||||
int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev) | ||||
{ | { | ||||
int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS); | ||||
struct mlx5_fw_page *fwp; | struct mlx5_fw_page *fwp; | ||||
struct rb_node *p; | struct rb_node *p; | ||||
int nclaimed = 0; | int nclaimed = 0; | ||||
int err; | int err; | ||||
do { | do { | ||||
p = rb_first(&dev->priv.page_root); | p = rb_first(&dev->priv.page_root); | ||||
if (p) { | if (p) { | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |