aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-06-14 02:56:52 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-14 02:56:52 -0400
commit25c43bf13b1657d9a2f6a2565e9159ce31517aa5 (patch)
treec1fef736d3227dbd3788206c746d00763247f232 /net/core/sock.c
parenta2f0fad32b0d0022c7e5706d333d74a9579f3742 (diff)
parentc8d17b451aa18b07b60e771addf17a5fdd4138c7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index e72633c346b1..7063c329c1b6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -354,15 +354,12 @@ void sk_clear_memalloc(struct sock *sk)
354 354
355 /* 355 /*
356 * SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward 356 * SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward
357 * progress of swapping. However, if SOCK_MEMALLOC is cleared while 357 * progress of swapping. SOCK_MEMALLOC may be cleared while
358 * it has rmem allocations there is a risk that the user of the 358 * it has rmem allocations due to the last swapfile being deactivated
359 * socket cannot make forward progress due to exceeding the rmem 359 * but there is a risk that the socket is unusable due to exceeding
360 * limits. By rights, sk_clear_memalloc() should only be called 360 * the rmem limits. Reclaim the reserves and obey rmem limits again.
361 * on sockets being torn down but warn and reset the accounting if
362 * that assumption breaks.
363 */ 361 */
364 if (WARN_ON(sk->sk_forward_alloc)) 362 sk_mem_reclaim(sk);
365 sk_mem_reclaim(sk);
366} 363}
367EXPORT_SYMBOL_GPL(sk_clear_memalloc); 364EXPORT_SYMBOL_GPL(sk_clear_memalloc);
368 365
@@ -1872,7 +1869,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t gfp)
1872 1869
1873 pfrag->offset = 0; 1870 pfrag->offset = 0;
1874 if (SKB_FRAG_PAGE_ORDER) { 1871 if (SKB_FRAG_PAGE_ORDER) {
1875 pfrag->page = alloc_pages(gfp | __GFP_COMP | 1872 pfrag->page = alloc_pages((gfp & ~__GFP_WAIT) | __GFP_COMP |
1876 __GFP_NOWARN | __GFP_NORETRY, 1873 __GFP_NOWARN | __GFP_NORETRY,
1877 SKB_FRAG_PAGE_ORDER); 1874 SKB_FRAG_PAGE_ORDER);
1878 if (likely(pfrag->page)) { 1875 if (likely(pfrag->page)) {