linux/drivers/net/ethernet/mellanox/mlx4
Thadeu Lima de Souza Cascardo 117980c4c9 mlx4: allocate just enough pages instead of always 4 pages
The driver uses a 2-order allocation, which is too much on architectures
like ppc64, which has a 64KiB page. This particular allocation is used
for large packet fragments that may have a size of 512, 1024, 4096 or
fill the whole allocation. So, a minimum size of 16384 is good enough
and will be the same size that is used in architectures of 4KiB sized
pages.

This will avoid allocation failures that we see when the system is under
stress, but still has plenty of memory, like the one below.

This will also allow us to set the interface MTU to higher values like
9000, which was not possible on ppc64 without this patch.

Node 1 DMA: 737*64kB 37*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 51904kB
83137 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 10420096kB
Total swap = 10420096kB
107776 pages RAM
1184 pages reserved
147343 pages shared
28152 pages non-shared
netstat: page allocation failure. order:2, mode:0x4020
Call Trace:
[c0000001a4fa3770] [c000000000012f04] .show_stack+0x74/0x1c0 (unreliable)
[c0000001a4fa3820] [c00000000016af38] .__alloc_pages_nodemask+0x618/0x930
[c0000001a4fa39a0] [c0000000001a71a0] .alloc_pages_current+0xb0/0x170
[c0000001a4fa3a40] [d00000000dcc3e00] .mlx4_en_alloc_frag+0x200/0x240 [mlx4_en]
[c0000001a4fa3b10] [d00000000dcc3f8c] .mlx4_en_complete_rx_desc+0x14c/0x250 [mlx4_en]
[c0000001a4fa3be0] [d00000000dcc4eec] .mlx4_en_process_rx_cq+0x62c/0x850 [mlx4_en]
[c0000001a4fa3d20] [d00000000dcc5150] .mlx4_en_poll_rx_cq+0x40/0x90 [mlx4_en]
[c0000001a4fa3dc0] [c0000000004e2bb8] .net_rx_action+0x178/0x450
[c0000001a4fa3eb0] [c00000000009c9b8] .__do_softirq+0x118/0x290
[c0000001a4fa3f90] [c000000000031df8] .call_do_softirq+0x14/0x24
[c000000184c3b520] [c00000000000e700] .do_softirq+0xf0/0x110
[c000000184c3b5c0] [c00000000009c6d4] .irq_exit+0xb4/0xc0
[c000000184c3b640] [c00000000000e964] .do_IRQ+0x144/0x230

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Tested-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04 20:34:29 -04:00
..
alloc.c
catas.c mlx4_core: adjust catas operation for SRIOV mode 2011-12-13 13:56:08 -05:00
cmd.c mlx4_core: fix race on comm channel 2012-03-19 18:02:05 -04:00
cq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
en_cq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-01-02 18:56:49 -05:00
en_ethtool.c mlx4_en: eth statistics modification 2012-01-22 15:08:43 -05:00
en_main.c mlx4_en: set number of rx rings used by RSS using ethtool 2012-01-18 16:07:34 -05:00
en_netdev.c net/mlx4_en: Saving mem access on data path 2012-03-06 15:19:17 -05:00
en_port.c mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_port.h mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_resources.c net/mlx4: move RSS related definitions to be global 2011-11-27 17:17:03 -05:00
en_rx.c net/mlx4: fix sparse warnings on wrong type for RSS keys 2012-03-06 15:19:17 -05:00
en_selftest.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
en_tx.c net/mlx4: fix sparse warnings on TX blue flame buffer 2012-03-06 15:19:17 -05:00
eq.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
fw.c net/mlx4: remove unused functions 2012-03-06 15:19:18 -05:00
fw.h mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
icm.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
icm.h
intf.c mlx4_core: adjust catas operation for SRIOV mode 2011-12-13 13:56:08 -05:00
Kconfig
main.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
Makefile mlx4_core: resource tracking for HCA resources used by guests 2011-12-13 13:56:07 -05:00
mcg.c mlx4: attach multicast with correct flag 2012-02-14 14:11:58 -05:00
mlx4_en.h mlx4: allocate just enough pages instead of always 4 pages 2012-04-04 20:34:29 -04:00
mlx4.h InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
mr.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
pd.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
port.c InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
profile.c mlx4_core: Scale size of MTT table with system RAM 2012-03-12 16:24:59 -07:00
qp.c mlx4_core: remove buggy sched_queue masking 2012-03-06 14:43:50 -05:00
reset.c
resource_tracker.c mlx4_core: fix bug in modify_cq wrapper for resize flow. 2012-03-08 00:28:01 -08:00
sense.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
srq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00