net: Reduce queue allocation to one in kdump kernel
authorHariprasad Shenai <hariprasad@chelsio.com>
Wed, 8 Jun 2016 12:39:08 +0000 (18:09 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Jun 2016 18:13:58 +0000 (11:13 -0700)
When in kdump kernel, reduce memory usage by only using a single Queue
Set for multiqueue devices. So make netif_get_num_default_rss_queues()
return one, when in kdump kernel.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index e0bcc39f4a7d378ad9cb670feac96b59750c95f6..c43c9d2a88cfd950420eba39fbb999a5bc3c8c32 100644 (file)
 #include <linux/hrtimer.h>
 #include <linux/netfilter_ingress.h>
 #include <linux/sctp.h>
+#include <linux/crash_dump.h>
 
 #include "net-sysfs.h"
 
@@ -2249,7 +2250,8 @@ EXPORT_SYMBOL(netif_set_real_num_rx_queues);
  */
 int netif_get_num_default_rss_queues(void)
 {
-       return min_t(int, DEFAULT_MAX_NUM_RSS_QUEUES, num_online_cpus());
+       return is_kdump_kernel() ?
+               1 : min_t(int, DEFAULT_MAX_NUM_RSS_QUEUES, num_online_cpus());
 }
 EXPORT_SYMBOL(netif_get_num_default_rss_queues);