|
@@ -354,15 +354,12 @@ void sk_clear_memalloc(struct sock *sk)
|
|
|
|
|
|
/*
|
|
/*
|
|
* SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward
|
|
* SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward
|
|
- * progress of swapping. However, if SOCK_MEMALLOC is cleared while
|
|
|
|
- * it has rmem allocations there is a risk that the user of the
|
|
|
|
- * socket cannot make forward progress due to exceeding the rmem
|
|
|
|
- * limits. By rights, sk_clear_memalloc() should only be called
|
|
|
|
- * on sockets being torn down but warn and reset the accounting if
|
|
|
|
- * that assumption breaks.
|
|
|
|
|
|
+ * progress of swapping. SOCK_MEMALLOC may be cleared while
|
|
|
|
+ * it has rmem allocations due to the last swapfile being deactivated
|
|
|
|
+ * but there is a risk that the socket is unusable due to exceeding
|
|
|
|
+ * the rmem limits. Reclaim the reserves and obey rmem limits again.
|
|
*/
|
|
*/
|
|
- if (WARN_ON(sk->sk_forward_alloc))
|
|
|
|
- sk_mem_reclaim(sk);
|
|
|
|
|
|
+ sk_mem_reclaim(sk);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(sk_clear_memalloc);
|
|
EXPORT_SYMBOL_GPL(sk_clear_memalloc);
|
|
|
|
|