diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 53bc584..15e93c4 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -1030,14 +1030,17 @@ static int __net_init tcp_net_metrics_init(struct net *net)
 		else
 			slots = 8 * 1024;
 	}
-
+retry:
 	net->ipv4.tcp_metrics_hash_log = order_base_2(slots);
 	size = sizeof(struct tcpm_hash_bucket) << net->ipv4.tcp_metrics_hash_log;
 
-	net->ipv4.tcp_metrics_hash = kzalloc(size, GFP_KERNEL);
-	if (!net->ipv4.tcp_metrics_hash)
-		return -ENOMEM;
-
+	net->ipv4.tcp_metrics_hash = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
+	if (!net->ipv4.tcp_metrics_hash) {
+		if (slots <= 16)
+			return -ENOMEM;
+		slots >>= 1;
+		goto retry;
+	}
 	return 0;
 }
 
