Received: by 2002:ac8:760c:0:b0:40f:fb00:664b with SMTP id t12csp928157qtq; Thu, 14 Sep 2023 22:47:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7RzHXzzwhFxUzy2HQ5UU/A1xa23zRyBiN2a6QVFKFq9D9adBhy2uNL/LUqlAbfmsBn2kb X-Received: by 2002:a05:6358:3381:b0:135:46d9:12f7 with SMTP id i1-20020a056358338100b0013546d912f7mr1079971rwd.26.1694756847288; Thu, 14 Sep 2023 22:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694756847; cv=none; d=google.com; s=arc-20160816; b=Vv4F4/EIExZPj++nA2vdFxb0yxMARyZEEYD1WQmC8iM6mogfv9cxiTMsxv/eRocrtf JnQMBWpQemalxm0t0rouy/wqfHaWtM0iFFArOMpYelXJ8m3k85aJsVrb6cu61bXzt2DC pxS88vVOfheUiSE4xWyafgRPBFzNYxATnu9aReuxk30HRS48i/O2RECLdbiob7jPYJ5p /YdpuN87g5xyUxMbms/P8Iq96PVj5tLy6zV9sDV4r6dyALEO9H91/ZbTqn/Qz/nLv++l eZHA6a9hZaHJlDRiCJz3hVeteg0BNDHLti3faD5OIAxCVEHbZy/xEDzYRPk0YCsAobkC VxKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ob3uAvnOoSCrtCSZPkBDgY1akrbFBa78/VkbR/tD3Zk=; fh=NKb3TWg9eL6xs8Vxwi9FOq3dzfPUGYbfaX8ZdDC3d1Y=; b=TrjBfH3N8CqmbsDpwu6Kw0BdcS70eO0O0xrLnpwn5woUtYgL0glIelpTTAe5E4k5sK XypgYoazf9UUV/B9yXDdzvUIrEm8j6J+0cR+hLuWVBLxmxHYUOHnhIjOeGWq+AHJkjHf 0ZOp4H8QVI6rsGmlf/IxSJzpEG1Qa5yRPB9AetDU0bbRceEjMywS2JBdLfMPQOYJUhwO dTSxpBBUXbfUrQ6IB+pswjVuSrWjLDSOFuh24yQm7PWGrP1BHgToheTA1V0vCUr1YRb6 9DDZ04x7Ul8tDESBdLoz+84ABUom6t0VwJvSpfuBLrOJlOyxrMAM4FuQj9dnbdvOkAzO XUEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vOINow2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b00565f0087a6bsi2656978pgb.427.2023.09.14.22.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 22:47:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vOINow2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 3921283D6825; Thu, 14 Sep 2023 14:21:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbjINVUy (ORCPT + 99 others); Thu, 14 Sep 2023 17:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjINVUt (ORCPT ); Thu, 14 Sep 2023 17:20:49 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ADE52703 for ; Thu, 14 Sep 2023 14:20:45 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5925fb6087bso18420387b3.2 for ; Thu, 14 Sep 2023 14:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694726445; x=1695331245; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ob3uAvnOoSCrtCSZPkBDgY1akrbFBa78/VkbR/tD3Zk=; b=vOINow2YxM/MoSfukFZ+ffrZCGQymL1/8iS4WZMKdLIOjR5lWXaAC7A8DVAmDEuYSJ eVarJzpkG9cb+yEJ9ex8zSMdTP5BIxrCgLWVUJJWm+nuz4cuaxe6+ZKRFxf/vuDP1AOO Igxca97ZL1BJEgGVbJBDmAIu0+JF09MnlKp6LA4bb0yCKyk2vm8FTWyHVMQMx9bOhPcL RSJJwqI4cdBz7jr8JUBRzH3DJyaHjtl9/2b0Lfn4Yw3Hwn94ZF/Ci2oKsJGaHvOIgZhr HBhFoU6klN3eTC3QkiE+S58oOHd42DD4sL/C3/mvDNXWdPBu0fIcFFFyGOo3BC7IHyRy GU6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694726445; x=1695331245; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ob3uAvnOoSCrtCSZPkBDgY1akrbFBa78/VkbR/tD3Zk=; b=dJQKJgsVva0FbeJZkO46v4GrBdsLrUZSnsi/kb61vyg2poq5+9qLXtp3fS48aWJYiz QPcG0Ux0noZxgcv/HeWqxU2z+Ny+G7OV+G8U8JiHknpisAcwak3p4+9eRDX0uyLjQe3x wUR8xewO1x08zJU+6bMDoHviW1XHDxU5LCo8dnRQWYmVIfxOlSiIy2Q3+GmaU9WPBLh/ Gijpti7UFTYJbyncNeHYtmAoZ5CKtgmxkHrxC0YvPx568n2ajuRQ4gaqZLns9bJ4N1xC wMY5WN1nVO8Ek7GJysFoY3TS1pbP9M7ic1haxN1ENWuIPKmjPXBFKUMW35xSAaLlFCN5 kGWQ== X-Gm-Message-State: AOJu0YwHy6ayyfhkn8cxJioWh3Hp1wHRsLZ+WPFwqJsCHeBd0QIqBH2r Rz3UUHI32udJQPwCE8klSNWPVdoKm598Kw== X-Received: from shakeelb.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:262e]) (user=shakeelb job=sendgmr) by 2002:a81:af11:0:b0:565:9bee:22e0 with SMTP id n17-20020a81af11000000b005659bee22e0mr176595ywh.0.1694726444854; Thu, 14 Sep 2023 14:20:44 -0700 (PDT) Date: Thu, 14 Sep 2023 21:20:42 +0000 In-Reply-To: <20230901062141.51972-1-wuyun.abel@bytedance.com> Mime-Version: 1.0 References: <20230901062141.51972-1-wuyun.abel@bytedance.com> Message-ID: <20230914212042.nnubjht3huiap3kk@google.com> Subject: Re: [RFC PATCH net-next 0/3] sock: Be aware of memcg pressure on alloc From: Shakeel Butt To: Abel Wu Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Morton , Roman Gushchin , Michal Hocko , Johannes Weiner , Yosry Ahmed , "Matthew Wilcox (Oracle)" , Yu Zhao , Kefeng Wang , Yafang Shao , Kuniyuki Iwashima , Martin KaFai Lau , Breno Leitao , Alexander Mikhalitsyn , David Howells , Jason Xing , open list , "open list:NETWORKING [GENERAL]" , "open list:MEMORY MANAGEMENT" Content-Type: text/plain; charset="us-ascii" 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 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 14:21:01 -0700 (PDT) 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 pete.vger.email On Fri, Sep 01, 2023 at 02:21:25PM +0800, Abel Wu wrote: > [...] > As expected, no obvious performance gain or loss observed. As for the > issue we encountered, this patchset provides better worst-case behavior > that such OOM cases are reduced at some extent. While further fine- > grained traffic control is what the workloads need to think about. > I agree with the motivation but I don't agree with the solution (patch 2 and 3). This is adding one more heuristic in the code which you yourself described as helped to some extent. In addition adding more dependency on vmpressure subsystem which is in weird state. Vmpressure is a cgroup v1 feature which somehow networking subsystem is relying on for cgroup v2 deployments. In addition vmpressure acts differently for workloads with different memory types (mapped, mlocked, kernel memory). Anyways, have you explored the BPF based approach. You can induce socket pressure at the points you care about and define memory pressure however your use-case cares for. You can define memory pressure using PSI or vmpressure or maybe with MEMCG_HIGH events. What do you think? thanks, Shakeel