Re: [PATCH] SUNRPC: Fixup socket wait for memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Trond, sorry for the mess :(

On Wed, Jan 6, 2016 at 11:38 AM, Trond Myklebust
<trond.myklebust@xxxxxxxxxxxxxxx> wrote:
> We're seeing hangs in the NFS client code, with loops of the form:
>
>
...

>  static void xs_write_space(struct sock *sk)
>  {
>         struct socket *sock;

It seems you no longer need this @sock variable

> +       struct socket_wq *wq;
>         struct rpc_xprt *xprt;
>
>         if (unlikely(!(sock = sk->sk_socket)))

if (!sk->sk_socket)
        return;

Maybe you don't even need to test sk_socket, but probably better not
leave it for this fix.

> @@ -1618,10 +1608,14 @@ static void xs_write_space(struct sock *sk)
>
>         if (unlikely(!(xprt = xprt_from_sock(sk))))
>                 return;
> -       if (test_and_clear_bit(SOCKWQ_ASYNC_NOSPACE, &sock->flags) == 0)
> -               return;
> +       rcu_read_lock();
> +       wq = rcu_dereference(sk->sk_wq);
> +       if (!wq || test_and_clear_bit(SOCKWQ_ASYNC_NOSPACE, &wq->flags) == 0)
> +               goto out;
>
>         xprt_write_space(xprt);
> +out:
> +       rcu_read_unlock();
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux