Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp274681rdb; Thu, 19 Oct 2023 04:22:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvHyRRhYDxtcegj4uglv/DKE85LIgCp9CDh+UPydSRnJsONd0EjCMtw4Cjc2PNU1N4qbkp X-Received: by 2002:a05:6808:19a7:b0:3b2:e3d0:863f with SMTP id bj39-20020a05680819a700b003b2e3d0863fmr2066130oib.13.1697714552605; Thu, 19 Oct 2023 04:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697714552; cv=none; d=google.com; s=arc-20160816; b=gkVJif24gm8+ra1Gq4gTQLUqOXwCboCci5a17c/jWa/YkUwSP2MehpYv9bAoiQyzcy +Ezggl0lVUlx0FaSCdNhTf/8CXVkf/u6AlsuhyPjJwhrOEAj1PcW1hHWZvxdZUrNM8LB rRlfnjL9WxAKERi8257hah4JKuqml8MJnrD5NulDqreAyt/M+veuwE6K2kALuhQ97+gf Iby+folgCBxXM7doAiIqSYaP5f0wLCyX5lq2pORAXysROTTvtDxPoqVdUM7XVM9PdMEt /MgRAm3LoR0nfYHpuGanJwK/uNtTEPIyl90ikoHZLsHlcAbavLX3yTf/EPFxcL0QpGQp TGNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+pZUkJVQsJVYjHJbhfYRUL1BGoXYIgN45kZzTiGXTQQ=; fh=S4qzCZwG7/wb0tcvfe++1iKuGut9XETlfBxPxYnkpBw=; b=mGFJ/1AAnoRH7R8PGU165HAJcw/PvxELeYMx5bVg9pzVf5YyqZqfX1Iltg3poT3mnk +qsxj4joAu89B6/nLygvK2zRersB5Kv+ipg6FJ0Zr10NfSF19Y1ZMPkRaIDMfCMBJ+kp i9sHe/ZgWAC5Q1nU1BDau0GP4ClXxw0o9ncI/B8/9fY47V1t+oS8haWv5dNBeqMhD7QM 7gCZvQ9sDklUUpx0FAj6h9AmHvF0Cd7h89MNjLRSH9RFrQGLc/KMs6LyXBSPJ7X7uBZN af9R/3iUX2LMeVI0el61dyovGwouf7uOCKsFOKMT6iUl7VyKbU92kkLBg+AmSZBxAsDX tDqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=ALrZW5e+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z16-20020a656650000000b0058b8c72c5ddsi3974190pgv.607.2023.10.19.04.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:22:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=ALrZW5e+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C3AEF8182EFB; Thu, 19 Oct 2023 04:22:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345340AbjJSLWX (ORCPT + 99 others); Thu, 19 Oct 2023 07:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345316AbjJSLWV (ORCPT ); Thu, 19 Oct 2023 07:22:21 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F070811B for ; Thu, 19 Oct 2023 04:21:57 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c77449a6daso64073095ad.0 for ; Thu, 19 Oct 2023 04:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1697714517; x=1698319317; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+pZUkJVQsJVYjHJbhfYRUL1BGoXYIgN45kZzTiGXTQQ=; b=ALrZW5e+yyjg56xjvaR0sJ3nlXARIc9t4B44KPzrtq2Gn954xVVw8D4QbvSX2mqqXw Gf1v9zk0LHlPpN/yI9NyIGGt13ArQO6it9Er11JZKB7peHF2XQOq+13mfhum3z7vt0OV uW8K+7GPkSTmQVeiPE28ZQut6fdfHrWq5zjkxRfgx+SxZkLBjWeUHIIyZiuLbTIstZGA MIAepzUh766Re4ClvvvHFTPsobvW7jkpCEmi6y59L4Z9ZPTFbg3raizKprP0OmOs8oL3 y/XFJj6iOfuR+K29ErJuguE6iQDB9wcN7HwQcfuyicFIJ8ibrl5s6ebizv4x7R2yCnxO q0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697714517; x=1698319317; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+pZUkJVQsJVYjHJbhfYRUL1BGoXYIgN45kZzTiGXTQQ=; b=lJqs7nGUqZkVewkqwNJRJvet5TcRfCsnJ6yuDQlOeiBgh6UgIWDFCOEahAdFtJOHVN /hNcfHGygPEQSTTnivRD01Xo6IRg4ki+3etg7cx2zWGD9xNRpq1pdu4Z6Y75YTHWCe31 q+feS6nmOyebZHOLwliQquZtX4B6wx0K+VkvpQjeH85NO9a7jJyeNGts/n8L9y/q70JJ jh2NqnuOPDzgs8qgeU3uAGPANLqorNZfOMC+p3BAPGwlSUwUUqQfCnd2K6sDDgZSOq7U uFJABTZKUdeUP0Vq6VFSZNmdUbEJPgTmzYPCw+csBL8QmdB/SCOhxIbsgZkK9kEBAgvu NKYw== X-Gm-Message-State: AOJu0Yyf9zPk+JwQtoTlRpjKygEhtltCWZzZRP2ZMZSdtPNU3MLVE9FB CBjuir9Qhfws2zMDecne0MSFrA== X-Received: by 2002:a17:902:ec88:b0:1c7:733b:27c7 with SMTP id x8-20020a170902ec8800b001c7733b27c7mr2029569plg.56.1697714516999; Thu, 19 Oct 2023 04:21:56 -0700 (PDT) Received: from [10.84.154.4] ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id jb11-20020a170903258b00b001c9c6a78a56sm1708399plb.97.2023.10.19.04.21.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 04:21:56 -0700 (PDT) Message-ID: <5283655b-b8c6-43da-939e-5a0d088caad6@bytedance.com> Date: Thu, 19 Oct 2023 19:21:48 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Re: [PATCH net-next v2 3/3] sock: Fix improper heuristic on raising memory To: Shakeel Butt Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231016132812.63703-1-wuyun.abel@bytedance.com> <20231016132812.63703-3-wuyun.abel@bytedance.com> Content-Language: en-US From: Abel Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:22:30 -0700 (PDT) On 10/16/23 11:52 PM, Shakeel Butt Wrote: > On Mon, Oct 16, 2023 at 6:28 AM 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 Thanks!