]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Jun 2018 15:01:44 +0000 (11:01 -0400)
commit89b1229abd53103b983f6cf8af2354985b4a5c9e
treee6fa08e681b8557beaab0fb7e8bf5cf313b751b4
parent945909191d5ccebbbef467913abbf9a0c00b9555
mlx4_core: restore optimal ICM memory allocation

Commit ba0a16f8bd07 ("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: ba0a16f8bd07 ("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>
drivers/net/ethernet/mellanox/mlx4/icm.c