mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
tcp: replace hard coded GFP_KERNEL with sk_allocation
This fixed a lockdep warning which appeared when doing stress
memory tests over NFS:
inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
page reclaim => nfs_writepage => tcp_sendmsg => lock sk_lock
mount_root => nfs_root_data => tcp_close => lock sk_lock =>
tcp_send_fin => alloc_skb_fclone => page reclaim
David raised a concern that if the allocation fails in tcp_send_fin(), and it's
GFP_ATOMIC, we are going to yield() (which sleeps) and loop endlessly waiting
for the allocation to succeed.
But fact is, the original GFP_KERNEL also sleeps. GFP_ATOMIC+yield() looks
weird, but it is no worse the implicit sleep inside GFP_KERNEL. Both could
loop endlessly under memory pressure.
CC: Arnaldo Carvalho de Melo <[email protected]>
CC: David S. Miller <[email protected]>
CC: Herbert Xu <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
05c6a8d7a7
commit
aa1330766c
6 changed files with 15 additions and 13 deletions
|
|
@ -591,7 +591,7 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
|
|||
}
|
||||
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
|
||||
}
|
||||
if (tcp_alloc_md5sig_pool() == NULL) {
|
||||
if (tcp_alloc_md5sig_pool(sk) == NULL) {
|
||||
kfree(newkey);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue