Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36864723rwd; Tue, 11 Jul 2023 06:43:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlG639tIn/xRk6jp9cz+0hDld3fUbeFRC1eAuMXr6ps2lPDOuisF3gdttZ6qn8PY+d+FTGs1 X-Received: by 2002:a17:902:b682:b0:1b6:4bbd:c3a7 with SMTP id c2-20020a170902b68200b001b64bbdc3a7mr11102467pls.66.1689083007912; Tue, 11 Jul 2023 06:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689083007; cv=none; d=google.com; s=arc-20160816; b=CO2XzXtMPsBP8pJLhcArNrclY0h0WHNSjv2ym/CQrDWoBqu4m4EtdpEiybxi3NC6AM KzUupw/UlWdKnkrwIAZqWD9P1H3WVNcsk6tX5Ez569eiEUSNTROBkbjPjsIQZ791fHVz cqHwJeMgU0H1XZRfGSWrgU+KLDm+CPXAVeJupV8OxXUrbFdvrGh7+aqdV+lDfaf7iCyg v+Af7oO0BOCWHnbDrgt8hFVchyILYNMfcB1yi4DgALspkA+gb93gl2V3lsQbdklwN4UN 2L/MaIZSfLmtdaUKlMx3C37zKjOEyKjGEKVhL/hCYtroGHyUVI8HrlZe1HuZ7TxUOJcG oSMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WF8p9HwwgSPuKR34SMZuqSQ7aAssq/odh5sAxqcKAUo=; fh=Mx2ihsaD/h9T0fEYvM4gkPKOh7zx2M83nAFYukeRTlc=; b=TIygyESroTW0vtKFuhHqqWWLYl5zpWIEyW//Z4jD4WVNXb/iLAKnb45m9LnOolir3I ce/EuJJZU+VOpfop8iC3lAMp7zUWrrAHfYAlpP/TzRYQ3FFgYs4/ny+xd/ZSNNRGDMDT JTQty/vWE2aBZhGvVOXzSjT+IEguxD97njMVMABjdccvZOCqRtSjlly02h5gpdOX4vJ2 e4BrvGoxoF5xXbx7IoXcRKTEF00unE/gEFW/LpeF7JUjMymelGjWfOvyJR2vNvEs0Qi6 tG/31zUdbEn05TFcvFyeVpPOE9DTrMP6Wigx8CXrBjnuyJWwHAqisJTZVU6z/4wbFpwt XjuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=PfObz486; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky16-20020a170902f99000b001b25ade9ea3si1582056plb.337.2023.07.11.06.43.10; Tue, 11 Jul 2023 06:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=PfObz486; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbjGKMnM (ORCPT + 99 others); Tue, 11 Jul 2023 08:43:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbjGKMnK (ORCPT ); Tue, 11 Jul 2023 08:43:10 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 863421708 for ; Tue, 11 Jul 2023 05:42:39 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6682909acadso3038354b3a.3 for ; Tue, 11 Jul 2023 05:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1689079359; x=1691671359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WF8p9HwwgSPuKR34SMZuqSQ7aAssq/odh5sAxqcKAUo=; b=PfObz486Wz+B8XCRMJmNpdOHd0bdAenCGoIFIrS0nn6pqgOGHIHHLLi/E7y4xelPQs oV1L5cDtGQ4gFHo4+itEHIwzUsNI9UXysv8UU/Pza3CLcUbZHUcxkt1As11YdvxnX8RF H17ZVvTu4nrEDSvdfN39NUxyIGNfeoTwnjdkSADFNYnqT8BI11t6wbWjHwH7o/9kadrH e5S5yw3IMsz3lksjyY+6iOF1Q4m7p0LVb07p4UTqbAdR2d9VI1K3CWAVsuHGT4SgzzBo xLZVs2ZfUmoYmSJPyCtnkjpSavzGDmGYFi8eCIFGc6qahboTah/quQSujY0SX5PCPa3e hfRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689079359; x=1691671359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WF8p9HwwgSPuKR34SMZuqSQ7aAssq/odh5sAxqcKAUo=; b=TGUaZglEehaefF6CRYm4zlO5yvzIZuDc4z5AdhhBA/ltl9hi6j6DaoqgVPp2KpGgDU Hyi9I+xpAj9QcmfswpadhNfDDFOkW+ou8QQjKaTSYbs/jSZNxyfZ1/ZbjDZQ2LLe2HtN QTAUnxGaTFYMyQoC69Exi9QBTlchziWb08oGx/sCYByajdEcA3pn5PL5JISYBbRGment qfrHUjVx8fi7thugjHt5720a/4QPk4k0kNZojZqC1/SLp2A0ptcB6REMCO2ua25qJfVb ePKHFtdzw/yG2Ax8olJzLt18uGYNVdapYR9A5IJkLFVfevzRwLwP68JoZSEb6AvWYlL6 +vKg== X-Gm-Message-State: ABy/qLYZgwWzxA4USgFZUx1zCQCNec5sOxmGhs1SZCuxfNFy4lVOiLRT 6ye+uTyyoOFQdg46ceQJ+PumEg== X-Received: by 2002:a05:6a20:1456:b0:12d:d17d:c811 with SMTP id a22-20020a056a20145600b0012dd17dc811mr13827670pzi.21.1689079358984; Tue, 11 Jul 2023 05:42:38 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id d27-20020a63735b000000b0055c0508780asm1512222pgn.73.2023.07.11.05.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 05:42:38 -0700 (PDT) From: Abel Wu To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , David Ahern , Yosry Ahmed , "Matthew Wilcox (Oracle)" , Yu Zhao , Abel Wu , Yafang Shao , Kefeng Wang , Kuniyuki Iwashima , Martin KaFai Lau , Alexander Mikhalitsyn , Breno Leitao , David Howells , Jason Xing , Xin Long Cc: Michal Hocko , linux-kernel@vger.kernel.org (open list), netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), cgroups@vger.kernel.org (open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)), linux-mm@kvack.org (open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)) Subject: [PATCH RESEND net-next 2/2] net-memcg: Remove redundant tcpmem_pressure Date: Tue, 11 Jul 2023 20:41:44 +0800 Message-Id: <20230711124157.97169-2-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230711124157.97169-1-wuyun.abel@bytedance.com> References: <20230711124157.97169-1-wuyun.abel@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As {socket,tcpmem}_pressure are only used in default/legacy mode respectively, use socket_pressure instead of tcpmem_pressure in all kinds of cgroup hierarchies. Signed-off-by: Abel Wu --- include/linux/memcontrol.h | 3 +-- mm/memcontrol.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5860c7f316b9..341d397186ff 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -288,7 +288,6 @@ struct mem_cgroup { /* Legacy tcp memory accounting */ bool tcpmem_active; - int tcpmem_pressure; #ifdef CONFIG_MEMCG_KMEM int kmemcg_id; @@ -1728,7 +1727,7 @@ void mem_cgroup_sk_free(struct sock *sk); static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) { if (!cgroup_subsys_on_dfl(memory_cgrp_subsys)) - return !!memcg->tcpmem_pressure; + return !!memcg->socket_pressure; do { if (time_before(jiffies, READ_ONCE(memcg->socket_pressure))) return true; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8ca4bdcb03c..e9e26dbd65b5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7292,10 +7292,10 @@ bool mem_cgroup_charge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages, struct page_counter *fail; if (page_counter_try_charge(&memcg->tcpmem, nr_pages, &fail)) { - memcg->tcpmem_pressure = 0; + memcg->socket_pressure = 0; return true; } - memcg->tcpmem_pressure = 1; + memcg->socket_pressure = 1; if (gfp_mask & __GFP_NOFAIL) { page_counter_charge(&memcg->tcpmem, nr_pages); return true; -- 2.37.3