Re: [PATCH net v3 3/3] sock: Ignore memcg pressure heuristics when raising allocated

From: Simon Horman
Date: Mon Oct 23 2023 - 03:50:18 EST


On Thu, Oct 19, 2023 at 08:00:26PM +0800, Abel Wu wrote:
> Before sockets became aware of net-memcg's memory pressure since
> commit e1aab161e013 ("socket: initial cgroup code."), the memory
> usage would be granted to raise if below average even when under
> protocol's pressure. This provides fairness among the sockets of
> same protocol.
>
> That commit changes this because the heuristic will also be
> effective when only memcg is under pressure which makes no sense.
> So revert that behavior.
>
> After reverting, __sk_mem_raise_allocated() no longer considers
> memcg's pressure. As memcgs are isolated from each other w.r.t.
> memory accounting, consuming one's budget won't affect others.
> So except the places where buffer sizes are needed to be tuned,
> allow workloads to use the memory they are provisioned.
>
> Signed-off-by: Abel Wu <wuyun.abel@xxxxxxxxxxxxx>
> Acked-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
> Acked-by: Paolo Abeni <pabeni@xxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>