From: Daniel Jurgens Date: Tue, 6 Mar 2018 21:49:08 +0000 (-0800) Subject: mlx4: change the ICM table allocations to lowest needed size X-Git-Tag: v4.1.12-124.31.3~896 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e7567cf1d53bddbe233dabea5c632658671dae9e;p=users%2Fjedix%2Flinux-maple.git mlx4: change the ICM table allocations to lowest needed size The driver currently allocates 256KB contig memort for ICM tables which puts pressure on memory management to allocate such large contig page in fragmented memory system. Such allocation itself contributes to memory fragmentation and at times user process stalls for 10's of seconds leading to slow path dumps with mm lock contention. This change makes the driver allocate lowest page size needed for ICM allocation(8K), which fixes these stalls. With 4K chunk sizes the QP table size is 4MB, which cannot be allocated by kmalloc. A larger design change would be neccesary to break up the table. With 8k chunks the same table is 2MB, which can be allocated by kmalloc. This large table allocation only happens once at driver load time. Orabug: 27718303 Signed-off-by: Daniel Jurgens Signed-off-by: Santosh Shilimkar Signed-off-by: Qing Huang Reviewed-by: Ajaykumar Hotchandani Reviewed-by: Yuval Shaia --- diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c index d633e926cf8f..84c5506aed9a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c @@ -42,13 +42,9 @@ #include "icm.h" #include "fw.h" -/* - * We allocate in as big chunks as we can, up to a maximum of 256 KB - * per chunk. - */ enum { - MLX4_ICM_ALLOC_SIZE = 1 << 18, - MLX4_TABLE_CHUNK_SIZE = 1 << 18 + MLX4_ICM_ALLOC_SIZE = 1 << 13, + MLX4_TABLE_CHUNK_SIZE = 1 << 13 }; static void mlx4_free_icm_pages(struct mlx4_dev *dev, struct mlx4_icm_chunk *chunk)