Alexei Starovoitov
4d1ceea851
net: ethtool: convert large order kmalloc allocations to vzalloc
...
under memory pressure 'ethtool -S' command may warn:
[ 2374.385195] ethtool: page allocation failure: order:4, mode:0x242c0c0
[ 2374.405573] CPU: 12 PID: 40211 Comm: ethtool Not tainted
[ 2374.423071] Call Trace:
[ 2374.423076] [<ffffffff8148cb29>] dump_stack+0x4d/0x64
[ 2374.423080] [<ffffffff811667cb>] warn_alloc_failed+0xeb/0x150
[ 2374.423082] [<ffffffff81169cd3>] ? __alloc_pages_direct_compact+0x43/0xf0
[ 2374.423084] [<ffffffff8116a25c>] __alloc_pages_nodemask+0x4dc/0xbf0
[ 2374.423091] [<ffffffffa0023dc2>] ? cmd_exec+0x722/0xcd0 [mlx5_core]
[ 2374.423095] [<ffffffff811b3dcc>] alloc_pages_current+0x8c/0x110
[ 2374.423097] [<ffffffff81168859>] alloc_kmem_pages+0x19/0x90
[ 2374.423099] [<ffffffff81186e5e>] kmalloc_order_trace+0x2e/0xe0
[ 2374.423101] [<ffffffff811c0084>] __kmalloc+0x204/0x220
[ 2374.423105] [<ffffffff816c269e>] dev_ethtool+0xe4e/0x1f80
[ 2374.423106] [<ffffffff816b967e>] ? dev_get_by_name_rcu+0x5e/0x80
[ 2374.423108] [<ffffffff816d6926>] dev_ioctl+0x156/0x560
[ 2374.423111] [<ffffffff811d4c68>] ? mem_cgroup_commit_charge+0x78/0x3c0
[ 2374.423117] [<ffffffff8169d542>] sock_do_ioctl+0x42/0x50
[ 2374.423119] [<ffffffff8169d9c3>] sock_ioctl+0x1b3/0x250
[ 2374.423121] [<ffffffff811f0f42>] do_vfs_ioctl+0x92/0x580
[ 2374.423123] [<ffffffff8100222b>] ? do_audit_syscall_entry+0x4b/0x70
[ 2374.423124] [<ffffffff8100287c>] ? syscall_trace_enter_phase1+0xfc/0x120
[ 2374.423126] [<ffffffff811f14a9>] SyS_ioctl+0x79/0x90
[ 2374.423127] [<ffffffff81002bb0>] do_syscall_64+0x50/0xa0
[ 2374.423129] [<ffffffff817e19bc>] entry_SYSCALL64_slow_path+0x25/0x25
~1160 mlx5 counters ~= order 4 allocation which is unlikely to succeed
under memory pressure. Convert them to vzalloc() as ethtool_get_regs() does.
Also take care of drivers without counters similar to
commit 67ae7cf1eeda ("ethtool: Allow zero-length register dumps again")
and reduce warn_on to warn_on_once.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-31 13:28:06 -05:00
..
2016-12-24 11:46:01 -08:00
2014-11-18 15:26:32 -05:00
2014-11-18 15:27:32 -05:00
2017-01-28 10:33:06 -05:00
2016-11-24 16:01:14 -05:00
2017-01-03 11:09:44 -05:00
2016-03-18 17:45:08 -04:00
2016-02-16 20:21:48 -05:00
2017-01-31 13:28:06 -05:00
2016-11-09 13:28:10 -05:00
2017-01-24 14:46:06 -05:00
2017-01-16 13:48:48 -05:00
2016-12-12 19:25:04 -08:00
2016-12-24 11:46:01 -08:00
2016-12-05 15:21:59 -05:00
2016-05-25 12:35:09 -07:00
2015-04-02 14:04:59 -04:00
2017-01-30 15:14:22 -05:00
2017-01-30 15:14:22 -05:00
2016-12-02 10:51:49 -05:00
2016-12-23 12:31:18 -05:00
2016-12-14 14:06:40 -08:00
2016-04-26 15:53:05 -04:00
2016-10-31 15:00:48 -04:00
2014-01-05 20:27:54 -05:00
2015-11-22 11:54:10 -05:00
2016-02-17 15:31:27 -05:00
2015-05-31 00:03:21 -07:00
2016-11-16 18:32:02 -05:00
2016-02-17 15:31:27 -05:00
2017-01-08 20:58:52 -05:00
2015-11-03 11:08:22 -05:00
2016-12-29 11:38:31 -05:00
2017-01-20 11:43:17 -05:00
2017-01-04 13:04:37 -05:00
2017-01-12 15:57:10 -05:00
2017-01-27 12:03:29 -05:00
2016-04-26 12:00:48 -04:00
2016-10-18 14:18:23 -04:00
2017-01-12 09:47:01 -05:00
2016-11-14 13:17:21 -05:00
2016-12-29 15:38:35 -05:00
2015-07-09 14:17:15 -07:00
2015-10-26 22:24:22 -07:00
2016-12-24 11:46:01 -08:00