lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Jun 2015 09:50:59 -0700
From:	Shaohua Li <shli@...com>
To:	<netdev@...r.kernel.org>
CC:	<davem@...emloft.net>, <Kernel-team@...com>,
	Amir Vadai <amirv@...lanox.com>,
	Ido Shamay <idos@...lanox.com>,
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH] mlx4_en: don't wait for high order page allocation

High order page allocation can cause direct memory compaction and harm
performance. The patch makes the high order page allocation don't wait,
so not trigger direct memory compaction with memory pressure. More
details can be found in a similar patch for net core:
http://marc.info/?l=linux-mm&m=143406665720428&w=2

Cc: Amir Vadai <amirv@...lanox.com>
Cc: Ido Shamay <idos@...lanox.com>
Cc: Eric Dumazet <edumazet@...gle.com>
Signed-off-by: Shaohua Li <shli@...com>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 2a77a6b..9bc4143 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -60,8 +60,11 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv,
 	for (order = MLX4_EN_ALLOC_PREFER_ORDER; ;) {
 		gfp_t gfp = _gfp;
 
-		if (order)
+		if (order) {
+			if ((PAGE_SIZE << (order - 1)) >= frag_info->frag_size)
+				gfp &= ~__GFP_WAIT;
 			gfp |= __GFP_COMP | __GFP_NOWARN;
+		}
 		page = alloc_pages(gfp, order);
 		if (likely(page))
 			break;
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ