From patchwork Mon Oct 16 13:28:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Wu X-Patchwork-Id: 13423245 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E70BA26E16 for ; Mon, 16 Oct 2023 13:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="lXfrO1fs" Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECADD9 for ; Mon, 16 Oct 2023 06:28:35 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ca72f8ff3aso5574765ad.0 for ; Mon, 16 Oct 2023 06:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1697462915; x=1698067715; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4aBj7JQ+keXNLTEJI81zHdQbbGhY/4fEWPU2oi6ixMU=; b=lXfrO1fsMGC5QLgGqwDORzAfq3rDCA3w7RGXyf2iWe3WmQWfS44Lf+j+p+44eXbyls o1R5kvy5gbTf20U9X1yBdcu1Bd8GOAVfAHvVWO9/R98BQRSyJDmED7IUFJnEc5DhvQjL nrOOOO+V3jXUJVWnfpMMLKnN/Wdbc+YxaUKl+aGBZfoTWZ61hNyHRoWvdrv63EakqxYC X9FZo5jchidkdqa8fl5bUixZE9gaY96K9J866QLg4u6Q0w6RgPmyF5RIyL9V4fhCwKwd Kcppcid4aFkRU0kITziw+Z05zPvg5BykAk8c5zwzuo2FQd6ZF18d2OJtQMIBy3kemfaq JDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697462915; x=1698067715; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4aBj7JQ+keXNLTEJI81zHdQbbGhY/4fEWPU2oi6ixMU=; b=pB73+udb58q2B5EE0aWIkRMM1uqjO4bJLIj/YdLh1ga5AjUDk9Q8S+ycH49c1O/tpG wNLa+ztHZPv9oee2zTpxnYNORiAxcyNDiRPHJxaLjOh/xvATydPU8jXZwaMgiMRXXn/o d96+MXjgB8xOXR5KryvvTwOutWsqEcAuR1CdodSjU3LHMyElwksGPx8px9Y+dwtEfAZI UfMpl0zOfjNnFo0MqAV1G1whWKgWgPdO4MF6wmJ0A8gyd1cfxxqnK3fYdTZfOmBXLOqy PKCCbi6SvVz9XtcowR4ztOqNdGSFYSh0aMGWrxW1z/42QEpz00PRNe3KWxPvyEPrgWMr 8u5Q== X-Gm-Message-State: AOJu0Yy5O5PLSOTwYg5hZDucoNx9H3y5iK2LOxslecxcsLc0dmOvaQ9s 6U2eMLkj4LjZvpdwquKUBCr5HQ== X-Google-Smtp-Source: AGHT+IGJ3DtPhfQwjYL4m3gc8AKJVML01Aff6rf6yFGw99xFhjdJoNkI5UMftZbSgs4Sf+513AQsog== X-Received: by 2002:a17:902:f907:b0:1c9:e6a0:edb6 with SMTP id kw7-20020a170902f90700b001c9e6a0edb6mr7341216plb.2.1697462914871; Mon, 16 Oct 2023 06:28:34 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id l21-20020a170902d35500b001c737950e4dsm8476287plk.2.2023.10.16.06.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:28:34 -0700 (PDT) From: Abel Wu To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shakeel Butt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Wu Subject: [PATCH net-next v2 1/3] sock: Code cleanup on __sk_mem_raise_allocated() Date: Mon, 16 Oct 2023 21:28:10 +0800 Message-Id: <20231016132812.63703-1-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.37.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Code cleanup for both better simplicity and readability. No functional change intended. Signed-off-by: Abel Wu Acked-by: Shakeel Butt --- net/core/sock.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 290165954379..43842520db86 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3039,17 +3039,19 @@ EXPORT_SYMBOL(sk_wait_data); */ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) { - bool memcg_charge = mem_cgroup_sockets_enabled && sk->sk_memcg; + struct mem_cgroup *memcg = mem_cgroup_sockets_enabled ? sk->sk_memcg : NULL; struct proto *prot = sk->sk_prot; - bool charged = true; + bool charged = false; long allocated; sk_memory_allocated_add(sk, amt); allocated = sk_memory_allocated(sk); - if (memcg_charge && - !(charged = mem_cgroup_charge_skmem(sk->sk_memcg, amt, - gfp_memcg_charge()))) - goto suppress_allocation; + + if (memcg) { + if (!mem_cgroup_charge_skmem(memcg, amt, gfp_memcg_charge())) + goto suppress_allocation; + charged = true; + } /* Under limit. */ if (allocated <= sk_prot_mem_limits(sk, 0)) { @@ -3104,8 +3106,8 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) */ if (sk->sk_wmem_queued + size >= sk->sk_sndbuf) { /* Force charge with __GFP_NOFAIL */ - if (memcg_charge && !charged) { - mem_cgroup_charge_skmem(sk->sk_memcg, amt, + if (memcg && !charged) { + mem_cgroup_charge_skmem(memcg, amt, gfp_memcg_charge() | __GFP_NOFAIL); } return 1; @@ -3117,8 +3119,8 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) sk_memory_allocated_sub(sk, amt); - if (memcg_charge && charged) - mem_cgroup_uncharge_skmem(sk->sk_memcg, amt); + if (charged) + mem_cgroup_uncharge_skmem(memcg, amt); return 0; } From patchwork Mon Oct 16 13:28:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Wu X-Patchwork-Id: 13423246 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 092FD26E16 for ; Mon, 16 Oct 2023 13:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="iU5vgA0O" Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E554AE3 for ; Mon, 16 Oct 2023 06:28:45 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-564b6276941so3318054a12.3 for ; Mon, 16 Oct 2023 06:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1697462925; x=1698067725; darn=vger.kernel.org; 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=6A4z/4U2K3WzAUzov3bGTmc+BOc6s6K9VnCG1bksGeE=; b=iU5vgA0OVfkZ/OHqpoVagiatPtAjNQ5vgTJNVH5VFLIFbndvQMMIWLwMqpiVr+a4yT 9LeZ+bLuGpHyenxEgmuNOH3f6o9wCT+fNQenj3E0niFsM9yRo63eNMococ44zktbmyOM kC6ofiNp2X59kQL9ltJ7IL/t3y0EpDBUUkAUuOV7iZ/yAOAG5SpyLSkUgD6b2qglA8RT PU2SguQu+pBw/3B5QaYNolWF0hfLXhsR+TWLl8uCtmd1Zg10JfmryeRMUOlIWP4tOKg+ HlXNxQVw+rgUBmdwhQgsQ3dioLPxEU8K6HgO+hVEnd1fQFTb4K5r+wPtmhoSYmLqZaUO EfnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697462925; x=1698067725; 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=6A4z/4U2K3WzAUzov3bGTmc+BOc6s6K9VnCG1bksGeE=; b=Wax3M7/jQZ3kTZwMdXdXwhV83H67NPN6gAgHxkAKOIedBbzi6b5iFCNPYtWhYH+H5B XOKM6ve15EKEDi24ZRqP3dJ0QZGElsOW0BHrZQ7eo6lk+0oJK/b6uwcZL9/p6ZibZTpb E+2AmiqI2yC7jNmlt7JO68taKKCQRxXuudzIBV+kCiPuse4gWNuJU7OV18KefubS79FV dVwmnlhmSBf+4S6Tz4ThVqAWHy7645ve98d24o14FRZ1Rw0zC3jRdXwS+6HBNOG4hrt5 SX60tEaRBLwNLRAlf3gGJchvSSDt7BDjlUu8m7IObZVndd24ab2X9hPkZnuA/7YD7yeE 2EIg== X-Gm-Message-State: AOJu0YzjghadbaXvTCDMDV1pZHt42574rL7D4QBJioaRpcPDxRBZ8aAZ 9tyvFehQNVWXm4DvcPeOWlxTkA== X-Google-Smtp-Source: AGHT+IG/aNFD8yOcB2CiaA9N6pA4YrFoO3SZXheTzPSixLt3q6ZWlan2LBv2aK3gxkV6vP0lWDraQg== X-Received: by 2002:a05:6a20:3d1b:b0:12e:4d86:c017 with SMTP id y27-20020a056a203d1b00b0012e4d86c017mr41504115pzi.10.1697462925400; Mon, 16 Oct 2023 06:28:45 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id l21-20020a170902d35500b001c737950e4dsm8476287plk.2.2023.10.16.06.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:28:45 -0700 (PDT) From: Abel Wu To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shakeel Butt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Wu Subject: [PATCH net-next v2 2/3] sock: Doc behaviors for pressure heurisitics Date: Mon, 16 Oct 2023 21:28:11 +0800 Message-Id: <20231016132812.63703-2-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20231016132812.63703-1-wuyun.abel@bytedance.com> References: <20231016132812.63703-1-wuyun.abel@bytedance.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org There are now two accounting infrastructures for skmem, while the heuristics in __sk_mem_raise_allocated() were actually introduced before memcg was born. Add some comments to clarify whether they can be applied to both infrastructures or not. Suggested-by: Shakeel Butt Signed-off-by: Abel Wu Acked-by: Shakeel Butt --- net/core/sock.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/sock.c index 43842520db86..9f969e3c2ddf 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3067,7 +3067,14 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) if (allocated > sk_prot_mem_limits(sk, 2)) goto suppress_allocation; - /* guarantee minimum buffer size under pressure */ + /* Guarantee minimum buffer size under pressure (either global + * or memcg) to make sure features described in RFC 7323 (TCP + * Extensions for High Performance) work properly. + * + * This rule does NOT stand when exceeds global or memcg's hard + * limit, or else a DoS attack can be taken place by spawning + * lots of sockets whose usage are under minimum buffer size. + */ if (kind == SK_MEM_RECV) { if (atomic_read(&sk->sk_rmem_alloc) < sk_get_rmem0(sk, prot)) return 1; @@ -3088,6 +3095,11 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) if (!sk_under_memory_pressure(sk)) return 1; + + /* Try to be fair among all the sockets under global + * pressure by allowing the ones that below average + * usage to raise. + */ alloc = sk_sockets_allocated_read_positive(sk); if (sk_prot_mem_limits(sk, 2) > alloc * sk_mem_pages(sk->sk_wmem_queued + From patchwork Mon Oct 16 13:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Wu X-Patchwork-Id: 13423247 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88E9F26E16 for ; Mon, 16 Oct 2023 13:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="dstMeNX/" Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9914ED for ; Mon, 16 Oct 2023 06:28:54 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c5c91bec75so28502355ad.3 for ; Mon, 16 Oct 2023 06:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1697462934; x=1698067734; darn=vger.kernel.org; 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=W5edFP5IbqRycra4JwAwr7sw7tdQ8rYxAUGEg4gbH5I=; b=dstMeNX/S/U6Zd5Z5IPb0P7sTdufE7lqsNm4s0QGvorWjKRX+UM52EXsnpN2UGO/b3 LlSHHASLlXtv8pxbvajKcPypiKB6305coJDK69Ijde8n4H8TpM+Dx5SY7J3MHCWtZeeP 40y4+KDWwCQ/+5TMdHkGjAc6BBWjKnKT7MnGU9GLBvLtFjJP453yt8iNF9VgJiJGdTUR IrLc1ACoH8gvqsUID+DU9u1ZY73dUmSwPA+qf1mThnFJTdRwI68wn/7hUJiBaGpEOLQm wuBqSYziHI6U/cn6sXobsz/ktXu29X8MviMMhN2VzDflqFmLF+0M6d4NgFPdl52R6dw+ i3KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697462934; x=1698067734; 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=W5edFP5IbqRycra4JwAwr7sw7tdQ8rYxAUGEg4gbH5I=; b=vd4l0j01bn+fwW8wksAlKkl9u4Ev4vIVxSY8eyr8vCZsakLclavQy1ANnwh72HEJPx 9lPnHM2jt/OlZSyd9pWfM1d8xz7azBPlAbP3m1pVjVKx70CvBdh5qlX44rHOk0bWYWPZ UrRUBbSgEs52LK6eUyh0ELW0tAmE09VqAZN2jaLcfVZKBTegM5i9q9dK1fH6Zju4r4/k hRHTU+ydkwc0Kv0Be3OROzf/zc+oJVUk8b99FRguBEkWRWsqaZMIigcpGhABlNeRkTC4 Bs0Dxq48u/4c/I5QslGxeqXDZ+Wpi2EjWmztTZpNr895rMFWxmlItehG2MktjoKyktcn kWAA== X-Gm-Message-State: AOJu0YzSuGcvsfSX/PbOxt0TNZZPNuJNGywpL+vUPj/grDL80I7jFjk7 0mqQ1KnTBh8s1YTaIHo0Owb0hA== X-Google-Smtp-Source: AGHT+IH0QjFU/M3nL9sQ7GpGqT0tk+CeTm1zv1UcyqYWSvsDzutF7dTumssneT1g+Jcbaao72hKBCQ== X-Received: by 2002:a17:902:c94f:b0:1c3:8464:cabd with SMTP id i15-20020a170902c94f00b001c38464cabdmr36959730pla.12.1697462934153; Mon, 16 Oct 2023 06:28:54 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id l21-20020a170902d35500b001c737950e4dsm8476287plk.2.2023.10.16.06.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:28:53 -0700 (PDT) From: Abel Wu To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shakeel Butt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Wu Subject: [PATCH net-next v2 3/3] sock: Fix improper heuristic on raising memory Date: Mon, 16 Oct 2023 21:28:12 +0800 Message-Id: <20231016132812.63703-3-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20231016132812.63703-1-wuyun.abel@bytedance.com> References: <20231016132812.63703-1-wuyun.abel@bytedance.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_NONE, 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 lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org 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 Acked-by: Paolo Abeni --- v2: - Ignore memcg pressure when raising memory allocated. --- net/core/sock.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 9f969e3c2ddf..1d28e3e87970 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3035,7 +3035,13 @@ EXPORT_SYMBOL(sk_wait_data); * @amt: pages to allocate * @kind: allocation type * - * Similar to __sk_mem_schedule(), but does not update sk_forward_alloc + * Similar to __sk_mem_schedule(), but does not update sk_forward_alloc. + * + * Unlike the globally shared limits among the sockets under same protocol, + * consuming the budget of a memcg won't have direct effect on other ones. + * So be optimistic about memcg's tolerance, and leave the callers to decide + * whether or not to raise allocated through sk_under_memory_pressure() or + * its variants. */ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) { @@ -3093,7 +3099,11 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) if (sk_has_memory_pressure(sk)) { u64 alloc; - if (!sk_under_memory_pressure(sk)) + /* The following 'average' heuristic is within the + * scope of global accounting, so it only makes + * sense for global memory pressure. + */ + if (!sk_under_global_memory_pressure(sk)) return 1; /* Try to be fair among all the sockets under global