lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1439241990.1084.15.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Mon, 10 Aug 2015 14:26:30 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jason Baron <jbaron@...mai.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [RFC PATCH net-next] tcp: reduce cpu usage under tcp memory
 pressure when SO_SNDBUF is set

On Mon, 2015-08-10 at 13:29 -0400, Jason Baron wrote:
> > +
> > 
> > 
> > 
> > 
> 
> thanks. better?
> 
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -798,8 +798,10 @@ static inline int sk_stream_min_wspace(const struct
> sock *sk)
> 
>  static inline int sk_stream_wspace(const struct sock *sk)
>  {
> -       if (sk->sk_effective_sndbuf)
> -               return sk->sk_effective_sndbuf - sk->sk_wmem_queued;
> +       int effective_sndbuf = sk->sk_effective_sndbuf;
> +
> +       if (effective_sndbuf)
> +               return effective_sndbuf - sk->sk_wmem_queued;
> 
>         return sk->sk_sndbuf - sk->sk_wmem_queued;
>  }
> 
> 

You need to use instead :

int effective_sndbuf = READ_ONCE(sk->sk_effective_sndbuf);

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ