linux-stable/net/core
Eric Dumazet ed98df3361 net: use __GFP_NORETRY for high order allocations
sock_alloc_send_pskb() & sk_page_frag_refill()
have a loop trying high order allocations to prepare
skb with low number of fragments as this increases performance.

Problem is that under memory pressure/fragmentation, this can
trigger OOM while the intent was only to try the high order
allocations, then fallback to order-0 allocations.

We had various reports from unexpected regressions.

According to David, setting __GFP_NORETRY should be fine,
as the asynchronous compaction is still enabled, and this
will prevent OOM from kicking as in :

CFSClientEventm invoked oom-killer: gfp_mask=0x42d0, order=3, oom_adj=0,
oom_score_adj=0, oom_score_badness=2 (enabled),memcg_scoring=disabled
CFSClientEventm

Call Trace:
 [<ffffffff8043766c>] dump_header+0xe1/0x23e
 [<ffffffff80437a02>] oom_kill_process+0x6a/0x323
 [<ffffffff80438443>] out_of_memory+0x4b3/0x50d
 [<ffffffff8043a4a6>] __alloc_pages_may_oom+0xa2/0xc7
 [<ffffffff80236f42>] __alloc_pages_nodemask+0x1002/0x17f0
 [<ffffffff8024bd23>] alloc_pages_current+0x103/0x2b0
 [<ffffffff8028567f>] sk_page_frag_refill+0x8f/0x160
 [<ffffffff80295fa0>] tcp_sendmsg+0x560/0xee0
 [<ffffffff802a5037>] inet_sendmsg+0x67/0x100
 [<ffffffff80283c9c>] __sock_sendmsg_nosec+0x6c/0x90
 [<ffffffff80283e85>] sock_sendmsg+0xc5/0xf0
 [<ffffffff802847b6>] __sys_sendmsg+0x136/0x430
 [<ffffffff80284ec8>] sys_sendmsg+0x88/0x110
 [<ffffffff80711472>] system_call_fastpath+0x16/0x1b
Out of Memory: Kill process 2856 (bash) score 9999 or sacrifice child

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-06 21:28:06 -08:00
..
datagram.c net, datagram: fix the incorrect comment in zerocopy_sg_from_iovec() 2013-10-29 00:19:04 -04:00
dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
dev_addr_lists.c net: Correctly sync addresses from multiple sources to single device 2014-01-23 13:06:34 -08:00
dev_ioctl.c net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
drop_monitor.c net: drop_monitor: fix the value of maxattr 2013-12-09 21:10:38 -05:00
dst.c
ethtool.c net: Add layer 2 hardware acceleration operations for macvlan devices 2013-11-07 19:11:41 -05:00
fib_rules.c net: Fix "ip rule delete table 256" 2013-11-08 14:53:10 -05:00
filter.c bpf: do not use reciprocal divide 2014-01-15 17:02:08 -08:00
flow.c
flow_dissector.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-14 14:42:42 -08:00
gen_estimator.c
gen_stats.c
iovec.c net: rework recvmsg handler msg_name and msg_namelen logic 2013-11-20 21:52:30 -05:00
link_watch.c
Makefile net: netprio: rename config to be more consistent with cgroup configs 2014-01-03 23:41:42 +01:00
neighbour.c net/neighbour: queue work on power efficient wq 2014-01-22 21:57:05 -08:00
net-procfs.c
net-sysfs.c net: fix "queues" uevent between network namespaces 2014-01-19 20:02:02 -08:00
net-sysfs.h net: netdev_kobject_init: annotate with __init 2014-01-05 20:27:54 -05:00
net-traces.c
net_namespace.c
netclassid_cgroup.c net: net_cls: move cgroupfs classid handling into core 2014-01-03 23:41:41 +01:00
netevent.c
netpoll.c netpoll: fix netconsole IPv6 setup 2014-02-06 21:28:06 -08:00
netprio_cgroup.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
pktgen.c pktgen: Use ether_addr_copy 2014-01-21 18:13:05 -08:00
request_sock.c
rtnetlink.c rtnetlink: fix oops in rtnl_link_get_slave_info_data_size 2014-02-04 20:28:51 -08:00
scm.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2013-09-07 14:35:32 -07:00
secure_seq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
skbuff.c net: Fix warning on make htmldocs caused by skbuff.c 2014-01-28 18:06:06 -08:00
sock.c net: use __GFP_NORETRY for high order allocations 2014-02-06 21:28:06 -08:00
sock_diag.c
stream.c net: replace macros net_random and net_srandom with direct calls to prandom 2014-01-14 15:15:25 -08:00
sysctl_net_core.c rps: NUMA flow limit allocations 2013-12-19 19:00:07 -05:00
timestamping.c
user_dma.c
utils.c net: make net_get_random_once irq safe 2013-10-25 19:03:39 -04:00