From ea4a324ce543435b5992ba54f412e24bcdb10ab8 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Mon, 4 Jun 2018 11:00:17 -0700 Subject: [PATCH] qcacmn: Not to be hard to make high order page kcompactd consumes many CPU cycles without being successful to make high-order page. One of the reason is WIFI driver is allocating order-3 page a lot. It shows 46% high-order allocation comes from WIFI driver. Of course, it should be fixed in MM layer but it is never easy stuff to fix in near future. Regardless of MM changes, drivers should do best effort to reduce high-order allocation, too. This patch fixes the problem via not waking kcompactd. Change-Id: I2bc3bf3ec96d32dd1a93c24edf2f590f331c0ed5 CRs-Fixed: 2265578 --- qdf/linux/src/qdf_nbuf.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index 40cb063c59ce..ed8080be60ea 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/qdf/linux/src/qdf_nbuf.c @@ -450,8 +450,18 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve, if (align) size += (align - 1); - if (in_interrupt() || irqs_disabled() || in_atomic()) + if (in_interrupt() || irqs_disabled() || in_atomic()) { flags = GFP_ATOMIC; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) + /* + * Observed that kcompactd burns out CPU to make order-3 page. + *__netdev_alloc_skb has 4k page fallback option just in case of + * failing high order page allocation so we don't need to be + * hard. Make kcompactd rest in piece. + */ + flags = flags & ~__GFP_KSWAPD_RECLAIM; +#endif + } skb = __netdev_alloc_skb(NULL, size, flags);