Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5730351imw; Wed, 20 Jul 2022 11:17:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+8mmA9ibrku/wn1dGvVPCHgqBoGUavhSKcUdzqmUz59lHfrtgG+i4jQRMhg26pDEcjJd4 X-Received: by 2002:a17:907:8a16:b0:72b:9196:f029 with SMTP id sc22-20020a1709078a1600b0072b9196f029mr37582072ejc.359.1658341021777; Wed, 20 Jul 2022 11:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658341021; cv=none; d=google.com; s=arc-20160816; b=Sz+YScNIOfinRtD26Sat5lgiL5sm/OAf5HgmUgBeLpZn/9EeeywGpcdgLkjshXb4kR mKzMGK5x3ZoC+DoSI+ntaKLDVZz/3zBR+n2rMa3QEKi/wOz/WOOjx5VqkowAL+YEDsku FGJ8vAre4ldwkNSPajpsWreCVl4f3skrvJRArtWH+zSBFP4fY+kQ6Pd/BK+k5uHwRLue bpT7b/vGd856z5JLreCfK84KDA/MGJgsDrjJIeADkURqv8Ihto6C189CXwVjtcJwTBeY bycwnnB6BfA1TxUbTpzEoe3edG5KJAfH+REdhelG+9OTvR9sAwRBIVJaef4r8515xlmB vM2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=0oKS/6oKFeFh2/7BcjLBJQRR5FdvAJqUhNLzT3Vks+P5txLLtd7H9MI3x1lNw+xHze waga+V5TqERSvK/oqVBzqELUDlyYiTEuM/m0RL3hQ85CC8EEVry3LsJ5QI3adOqDDzas CEQXWq3uh6crVrfzFLE/mCMTk0YYQJCtmFMFHidaFCQDJpyivXR0m4lWebA4qhxQMoYC vUoDVkol+jYfXPyG5BSQWxLhpHrtgv3E03/Va6s1FSkslsOLaJSDMEPGe9xnmOEm4BZd BTGGrU1SKq3iY6JT0LqQQzjgY18R0oPqwlLf2I738gWQMLFuz6XtIQ0xib/e9Qbhc3US 3DQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dnV0YHWv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd12-20020a1709076e0c00b0072ee6c76e3esi25268796ejc.790.2022.07.20.11.16.35; Wed, 20 Jul 2022 11:17:01 -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=@google.com header.s=20210112 header.b=dnV0YHWv; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbiGTSDh (ORCPT + 99 others); Wed, 20 Jul 2022 14:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230292AbiGTSDf (ORCPT ); Wed, 20 Jul 2022 14:03:35 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 885545D0F3 for ; Wed, 20 Jul 2022 11:03:34 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id z12so27242118wrq.7 for ; Wed, 20 Jul 2022 11:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=dnV0YHWvnhuMUuSd57347+DOzR3AxQcrR7zzAGoWSmv8OwPuA4SNbmOO5Dz88dFjqy kls9OTarVd8bmE/zaV7DVW5OrVc2W6xDg9rvm85GE0fVrn+2S8m/4yEbf3pPxfB1qZKb v3sjYgyUFN3/vHk3+826GcexfrrE6GCpCZu4Q6Bn1efuiZU9eBg1uXRDZTJRXJx3UKbN 2zfN3FZLP1hZvN7KZrO1h+8oAIhvt5/VumAis5ShZIb7OCuHVOo5kkDLK+zwYpcXRfgC lQX0lzUNZpJW6zkqJ6iPyGtc7lQuGW3RZ6Ssly/XvZ0alzMjN4C6DqQBTB3InJ3Gmly1 XlvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2YSXf98rTw+aM6nqedJXsMdekQD67mGphdqXFvr1fbM=; b=eyatIYC9q5OcYdM03vaulVIb6MksOGfvJYBRoHKr5x2Ne4cQxg26TXH9gjzSxA94Kt v6JXZZuiQhXPVUnYsszA3G9B1vnjoip32Xv2+FH1gGMJhJm8sjNh09CRbx1NLFC72Omu msV9saoExdJ1hatDL6uinPSTB+Jqdgz26sFl5wXdG4FcBCTp3+PN2xoRIDdq+x6dmkHy VWgDtnfISm7QK/LRzu2eevO+wbXObKOt73UwoXO+QCTxz5J8iku8h/kcDhVtgIjpD+vW 4ARk4ypYao+Lgu9+gCKHjTPmy0T3Z2qn18enpeKpIPauQw5Dx4zQ+Fb3cYrgxsCnbgAp LzMQ== X-Gm-Message-State: AJIora88OdCx0y8M38s0keIF/vuOr8TlHDUwmIDcZQ9uQ3kWRmPbiOWy +knGrmHpSv6NanykDLMcD89lTssQ2A6RiBDxjsbUYQ== X-Received: by 2002:a5d:5a82:0:b0:21e:2899:60bd with SMTP id bp2-20020a5d5a82000000b0021e289960bdmr9534113wrb.80.1658340212940; Wed, 20 Jul 2022 11:03:32 -0700 (PDT) MIME-Version: 1.0 References: <20220714064918.2576464-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 20 Jul 2022 11:02:56 -0700 Message-ID: Subject: Re: [PATCH v4] mm: vmpressure: don't count proactive reclaim in vmpressure To: Shakeel Butt Cc: Michal Hocko , Johannes Weiner , Roman Gushchin , Muchun Song , Andrew Morton , Matthew Wilcox , Vlastimil Babka , David Hildenbrand , Miaohe Lin , NeilBrown , Alistair Popple , Suren Baghdasaryan , Peter Xu , LKML , Cgroups , Linux MM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 On Wed, Jul 20, 2022 at 10:50 AM Shakeel Butt wrote: > > On Wed, Jul 20, 2022 at 2:24 AM Michal Hocko wrote: > > > [...] > > > > I think what we are missing here is > > - explain that this doesn't have any effect on existing users of > > vmpressure user interface because that is cgroup v1 and memory.reclaim > > is v2 feature. This is a trivial statement but quite useful for future > > readers of this commit > > - explain the effect on the networking layer and typical usecases > > memory.reclaim is used for currently and ideally document that. > > I agree with the above two points (Yosry, please address those) but > the following third point is orthogonal and we don't really need to > have an answer for this patch to be accepted. > That's great feedback, thanks Michal and Shakeel! How do you feel about the following commit message instead? Does it address your concerns?: memory.reclaim is a cgroup v2 interface that allows users to proactively reclaim memory from a memcg, without real memory pressure. Reclaim operations invoke vmpressure, which is used in cgroup v1 to notify userspace of reclaim efficiency, and used in both v1 and v2 as a signal for a memcg being under memory pressure for networking (see mem_cgroup_under_socket_pressure()). For the former, vmpressure notifications in v1 are not affected by this change since memory.reclaim is a v2 feature. For the latter, the effects of the vmpressure signal (according to Shakeel [1]) are as follows: 1. Reducing send and receive buffers of the current socket. 2. May drop packets on the rx path. 3. May throttle current thread on the tx path. Since proactive reclaim is invoked directly by userspace, not by memory pressure, it makes sense not to throttle networking. Hence, this change makes sure that proactive reclaim caused by memory.reclaim does not trigger vmpressure. [1] https://lore.kernel.org/lkml/CALvZod68WdrXEmBpOkadhB5GPYmCXaDZzXH=yyGOCAjFRn4NDQ@mail.gmail.com/ > > - how are we going to deal with users who would really want to use > > memory.reclaim interface as a replacement for existing hard/high > > memory reclaim? Is that even something that the interface is intended > > for? > > I do agree that this question is important. Nowadays I am looking at > this from a different perspective and use-case. More concretely how > (and why) to replace vmpressure based network throttling for cgroup > v2. I will start a separate thread for that discussion.