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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Dec 2022 19:28:14 +0000
From:   Shakeel Butt <shakeelb@...gle.com>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Ivan Babrou <ivan@...udflare.com>, Linux MM <linux-mm@...ck.org>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...nel.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Muchun Song <songmuchun@...edance.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Eric Dumazet <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, cgroups@...r.kernel.org,
        kernel-team <kernel-team@...udflare.com>
Subject: Re: Low TCP throughput due to vmpressure with swap enabled

On Mon, Nov 28, 2022 at 01:07:25PM -0500, Johannes Weiner wrote:
> 
[...]
> > With the patch applied I'm capped at ~120MB/s, which is a symptom of a
> > clamped window.
> > 
> > I can't find any sockets with memcg->socket_pressure = 1, but at the
> > same time I only see the following rcv_ssthresh assigned to sockets:
> 
> Hm, I don't see how socket accounting would alter the network behavior
> other than through socket_pressure=1.
> 

I think what is happening is that the tcp stack is calling
tcp_under_memory_pressure() and making decisions without going through
the memcg charge codepath which set or reset memcg->socket_pressure.
Most probably the socket is clamped due to memcg->socket_pressure and
then the kernel never tried to grow its buffers because
memcg->socket_pressure is still set and thus never tried the memcg
charge codepath which would have reset memcg->socket_pressure. (Maybe)
That is my guess but network experts CCed can correct me.

Anyways, I don't think the pressure mechanism which relies on successful
charging will work. I am brainstorming towards memory.high based network
throttling. Basically use penalty_jiffies (or something similar) to set
memcg->socket_pressure. However I want this to be opt-in as we do have
applications which prefer to be killed than be throttled. So, still
working on the fine details how this can be done without introducing a
rigid API.

Powered by blists - more mailing lists