Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2592379rdg; Mon, 16 Oct 2023 08:53:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMk2oUnbwABfMQlIbwXoZq6nkJY1uft7l+reihHKsuUtfH+A/Uic3hBixihINcMurUqEao X-Received: by 2002:a17:903:3206:b0:1ca:2c3b:7747 with SMTP id s6-20020a170903320600b001ca2c3b7747mr4047143plh.20.1697471593954; Mon, 16 Oct 2023 08:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697471593; cv=none; d=google.com; s=arc-20160816; b=N/MY2G3HTWglEqMO2OqmVk73JTZy6uGOq33fv6k1/2mguMDzqU057FuKDrBGn1orD2 I5ifzECn16ptMTWKy7Xibo1sQ/UFd8oIN0gIA46MoU/XwvA/X++OYe4ESxmugHmMU8bw Dpe4witEnqENeZx4homTX/SmkZ5jtSPnDbgoDEknbjNvAuPJ15vCjhhhEkw8Kv6Ut8OI eHvfaSGP0H1uLwrzN+z39r2lg9yufHzx7537KcodhLvza/JbhiD8v2FrPe3hMV9/0eBx iqflyUYUVEO9KAemu49ygAowwvIBnh/B4/4zkMMfjhGHV89A0r60lOXTD4qlcLdQT1DX dx5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1TOWBV0+RIkpT8pcDO7Atd39X0kSbmghLXKRHM4kosQ=; fh=8dhVyrqTL4GJ+/KdtCyqN7r5lciH89d4Zgu9S9o02zs=; b=g/C3arcDArMGjcsznD+EOsuqX0gFboF7cHDEUtsSo8RkIFVg8X5OZaDNB5BXgXmG95 FceaUWPgVu04pBilRblaAhxX/EDzAcQ9sWLsMLHcduarUIzBXplXNxf2IlVzcF7TgFHb koV1xxJaM5RLn4lizyq9waZ/ruf6ws6l9/OF3E9rQSaEN2f8/HcjE/Idg2gCplMf+3xN Y434v/ReKwjdH0/nuvuZbNIpd6Cg6UsPVI6Rwszwj8jkO8pLcOSlNGD58JclXbrsloRj oytDJswEegyjQJhY9H00uUB8MpyeCC0d5PcLX1CAZbdNr1bicgXKV/kO9vhdMeAlN+S1 Z6rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dICZq4t0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v7-20020a170902b7c700b001b86ddfd49bsi10021641plz.6.2023.10.16.08.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dICZq4t0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0A1C680B26B9; Mon, 16 Oct 2023 08:53:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233188AbjJPPxD (ORCPT + 99 others); Mon, 16 Oct 2023 11:53:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbjJPPxB (ORCPT ); Mon, 16 Oct 2023 11:53:01 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63673AD for ; Mon, 16 Oct 2023 08:53:00 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c9c145bb5bso301715ad.1 for ; Mon, 16 Oct 2023 08:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697471580; x=1698076380; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1TOWBV0+RIkpT8pcDO7Atd39X0kSbmghLXKRHM4kosQ=; b=dICZq4t0cexqn4kJRHeFjfmU8wr4q5lpjU0pU2PFdZ+erHfJQbHDqsdbV2XmVUEE7O PiZXmQnRWx4nswFMjqiKha+2rKxYr/6JxfTXIsqwT3BJYlO6n/Xv/2KEKIHWBD5KVeDW +2xqfM6xFudZ+vmwVtBXvuTzp50zCdb9pxit9r88PlJMUTvzVyCm2kMasaw/PuTkJJvZ U5DTPjiSO/vRpFY3qAarZbJk5QSk9JPhVBdxX7Iovxz++gU0rVB0mSQdqGEL3hrhsmEp jx6474ML2hj/1MQbwu6paHKbylqGSKPrPYvYfMosnDTeZhV3nJeLkM3R3ZkYbqnE9ZZE WoYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697471580; x=1698076380; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1TOWBV0+RIkpT8pcDO7Atd39X0kSbmghLXKRHM4kosQ=; b=Miew2eMbvSXKZhiZW4hFUSAsCm5th6tWysxMb6/qDdfLPFqz+/IbjyJLqK23Df4yYY W+NtNAx2H639TW+/6msdLnGaOu/waboSrs3oFyW/2ayD4ttHWq9vWGseQg4SKC80f6ye E9WxN/sL2c6SSG7gOp74mXg2ONC3ixGYw2KuPSahwiq9yB32+VMGUosHZfTl4LgNBB8X 0PA+IMCCL1n7drUq0S48+k3qr3XN29OXfIoIuaBaQxIjwIQ1v0KBS+lRmnNaS6W7gMYK kqSgfTCBrWoUjnJzHbepoy/JxsXIW4fcuIT3UI0nfeBQY8zCKjp+CJnlwlRKNqt56awH KBjw== X-Gm-Message-State: AOJu0YzsxKtCSIsrM3a2cWSFzpTWU9TD45ovzwhjnVKqLW4R+/UuR1QO DC00PmWo+rHtWTJwYeT66yCbhWn5bd3lPe/Vax4SsA== X-Received: by 2002:a17:902:f70b:b0:1c1:efe5:ccf8 with SMTP id h11-20020a170902f70b00b001c1efe5ccf8mr277015plo.17.1697471579647; Mon, 16 Oct 2023 08:52:59 -0700 (PDT) MIME-Version: 1.0 References: <20231016132812.63703-1-wuyun.abel@bytedance.com> <20231016132812.63703-3-wuyun.abel@bytedance.com> In-Reply-To: <20231016132812.63703-3-wuyun.abel@bytedance.com> From: Shakeel Butt Date: Mon, 16 Oct 2023 08:52:48 -0700 Message-ID: Subject: Re: [PATCH net-next v2 3/3] sock: Fix improper heuristic on raising memory To: Abel Wu Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:53:12 -0700 (PDT) On Mon, Oct 16, 2023 at 6:28=E2=80=AFAM 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. > Fix this by reverting to the behavior before that commit. > > After this fix, __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. > > Fixes: e1aab161e013 ("socket: initial cgroup code.") > Signed-off-by: Abel Wu Acked-by: Shakeel Butt