]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mlx4_core: restore optimal ICM memory allocation
authorEric Dumazet <edumazet@google.com>
Thu, 31 May 2018 12:52:24 +0000 (05:52 -0700)
committerBrian Maly <brian.maly@oracle.com>
Tue, 26 Jun 2018 19:06:27 +0000 (15:06 -0400)
commit7c324005fcea00aa52d29947891173d709eff936
tree6e3e7f3f2bbc4eeaf5b3d344706d52083837e912
parenta7efe18673608ac5f864aa1338c1f753096c1f64
mlx4_core: restore optimal ICM memory allocation

Commit 1383cb8103bb ("mlx4_core: allocate ICM memory in page size chunks")
brought two regressions caught in our regression suite.

The big one is an additional cost of 256 bytes of overhead per 4096 bytes,
or 6.25 % which is unacceptable since ICM can be pretty large.

This comes from having to allocate one struct mlx4_icm_chunk (256 bytes)
per MLX4_TABLE_CHUNK, which the buggy commit shrank to 4KB
(instead of prior 256KB)

Note that mlx4_alloc_icm() is already able to try high order allocations
and fallback to low-order allocations under high memory pressure.

Most of these allocations happen right after boot time, when we get
plenty of non fragmented memory, there is really no point being so
pessimistic and break huge pages into order-0 ones just for fun.

We only have to tweak gfp_mask a bit, to help falling back faster,
without risking OOM killings.

Second regression is an KASAN fault, that will need further investigations.

Fixes: 1383cb8103bb ("mlx4_core: allocate ICM memory in page size chunks")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Cc: John Sperbeck <jsperbeck@google.com>
Cc: Tarick Bedeir <tarick@google.com>
Cc: Qing Huang <qing.huang@oracle.com>
Cc: Daniel Jurgens <danielj@mellanox.com>
Cc: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry-picked from upstream commit
885892fb378dc096693557ba4f2b875188619b36)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
  replaced __GFP_DIRECT_RECLAIM with __GFP_WAIT due to kernel difference
  between UEK4 and upstream

Orabug: 27718303

Signed-off-by: Qing Huang <qing.huang@oracle.com>
Tested-by: June Wang <june.wang@oracle.com>
Tested-by: Rose Wang <rose.wang@oracle.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/mellanox/mlx4/icm.c