Re: sk_lock: inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W}usage

From: David Miller
Date: Thu Jul 09 2009 - 20:14:10 EST


From: Wu Fengguang <fengguang.wu@xxxxxxxxx>
Date: Thu, 9 Jul 2009 21:17:46 +0800

> @@ -2100,7 +2100,8 @@ void tcp_send_fin(struct sock *sk)
> } else {
> /* Socket is locked, keep trying until memory is available. */
> for (;;) {
> - skb = alloc_skb_fclone(MAX_TCP_HEADER, GFP_KERNEL);
> + skb = alloc_skb_fclone(MAX_TCP_HEADER,
> + sk->sk_allocation);
> if (skb)
> break;
> yield();

I think this specific case needs more thinking.

If the allocation fails, and it's GFP_ATOMIC, we are going to yield()
(which sleeps) and loop endlessly waiting for the allocation to
succeed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/