[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR11MB4107DCA9F443CB5BE3A94119DC719@DM6PR11MB4107.namprd11.prod.outlook.com>
Date: Mon, 8 May 2023 23:17:29 +0000
From: "Chen, Tim C" <tim.c.chen@...el.com>
To: "Zhang, Cathy" <cathy.zhang@...el.com>, "edumazet@...gle.com"
<edumazet@...gle.com>, "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>
CC: "Brandeburg, Jesse" <jesse.brandeburg@...el.com>, "Srinivas, Suresh"
<suresh.srinivas@...el.com>, "You, Lizhen" <lizhen.you@...el.com>,
"eric.dumazet@...il.com" <eric.dumazet@...il.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>
Subject: RE: [PATCH 1/2] net: Keep sk->sk_forward_alloc as a proper size
+
+ /* Reclaim memory to reduce memory pressure when multiple sockets
Improper comment style.
/*
* comment
*/
+ * run in parallel. However, if we reclaim all pages and keep
+ * sk->sk_forward_alloc as small as possible, it will cause
+ * paths like tcp_rcv_established() going to the slow path with
+ * much higher rate for forwarded memory expansion, which leads
+ * to contention hot points and performance drop.
+ *
+ * In order to avoid the above issue, it's necessary to keep
+ * sk->sk_forward_alloc with a proper size while doing reclaim.
+ */
+ if (reclaimable > SK_RECLAIM_THRESHOLD) {
+ reclaimable -= SK_RECLAIM_THRESHOLD;
+ __sk_mem_reclaim(sk, reclaimable);
+ }
}
/*
--
2.34.1
Powered by blists - more mailing lists