Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3165381iog; Mon, 27 Jun 2022 10:28:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sULdhPAmTAliZORStSIYOqErCPlOBizLy3V9Wn/n9PW/pjmps/jZNwnkUMFvUHevOyx6H2 X-Received: by 2002:a05:6402:4242:b0:437:7771:982c with SMTP id g2-20020a056402424200b004377771982cmr14538350edb.146.1656350916198; Mon, 27 Jun 2022 10:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656350916; cv=none; d=google.com; s=arc-20160816; b=L3XCKBEbNp17i6i2xLCFQ1wxJH0SlwjnKDwnvzxXzewxxe2YKt6X05dEWG+J05DFV7 N7uke9Tj9va+yuZ538czks9xsvhIhZ33zCZuy9CMVDafvkkLCvSW/OBLlvX+X5cYrOFU Qn8LXCwor7bQPMXzoGyggF8jePMJ282VxZAP9f2z43s3Mz+NhkmrBaYI1SSPaDyWLf6X 9U8NEczfauwx1AUJ8YOuVJTG2ft0mGP/91VDqu0IU4MTRt7hmIdf+Ymz+Mi6QB43i1ql ynJ2hAaowo9sHD9EIIb1clhKYr6tsS6oGT4MpBks9x1vddQadgYUxP4KX0+tC/yzLntM za5g== 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=/ZvfkO3IFf3n/ZVC71sBF9P6CPQM5ABge97UmMt98ps=; b=WVi//braC3rt+8Xd+m0MLQwy04/Ycd9JGNRwbX9PNA3mGLi/J+eAmHxSltpqh8ZfVx AZ7Vzbjq3auNGJ88aWbmysyYjoovkUaBXuVfk+YA0sIkNEq6JeFaChMpsdizGB63z5Bd YDWcDkv3ZzcEMi4Sgz2LKx5qfrqzTT4dtuIZ94XKftM53l64T2Xb8YL4REVcqFzQGiWw JY+UPWrDHFL8zRBrngJJcRXYLaWpboDrIDchN+YfV7k/dKO6Uhq+lu3ZMe5WRAzGqdof DQR0pKNubsLI/drncReFMt+qtD1tZya1MFXfr7p7xDZgNXCbSHDcJzLbD6iRPayOyNGv etZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MjiW4IZI; 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 hz4-20020a1709072ce400b006df76385e32si10551585ejc.722.2022.06.27.10.28.10; Mon, 27 Jun 2022 10:28:36 -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=MjiW4IZI; 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 S239491AbiF0REd (ORCPT + 99 others); Mon, 27 Jun 2022 13:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235533AbiF0REc (ORCPT ); Mon, 27 Jun 2022 13:04:32 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E20D14D25 for ; Mon, 27 Jun 2022 10:04:31 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id b26so1575856wrc.2 for ; Mon, 27 Jun 2022 10:04:31 -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=/ZvfkO3IFf3n/ZVC71sBF9P6CPQM5ABge97UmMt98ps=; b=MjiW4IZIKNvnRLaZM4hrpDs4I/vEqDj5/3xOzyG/gv8hlURBfdXynnwR5LA4UVW70b o6v1EJHUzimguE8TQT2qD+Ab522RK1leX7GKKUj72qeBt/3gTwNZo3T7zB5s5GAWR77C kmZiLNM8c8QVC160v7Ww9LlRpm1EKOj9ecAo/uAQCARN/f/mgZjude7rkreOk0yXGga4 Yc2oi4K5OYLJIn0wx5Z3wx0IbtNw5aTVQ4dxcBthCiW5NNtCuEvfM0Mj9ZlgHR8TiiCA U8V6ZkaLIF2+CvNbXCBVwy7P4laWgV05N1TKs+pMvPm7BtkXpcmeznV712/+QiAYbgHU HMwQ== 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=/ZvfkO3IFf3n/ZVC71sBF9P6CPQM5ABge97UmMt98ps=; b=y9o6Eaqu2vyClAC8NQ6Ft4+oWte7Umf/mn0YdXTa+Sm7rloCSCKbFHUJ4z982Ye/3O /ljLP442urvKKusvSGEKsBHPaz0AL6iHpd7iVfzABlnJQ/LLeUlyCsRLEtd/GAiDuGnL IpVtSwdbQZcetIp12ZsFDmRnpPY1MjnlKL+eE7kAvvGCrNQsr9PgP34n66habFBxorSh h8C/jRnEcNiWplFVJsWF0VFs5w5mAOpa+qCCyUILHuu4AFD3ZB1b8H3XXDUuJFkmYNYJ PZ9SpBKQvg1ExzVWKp9To8ptlwbfNQ7Xxw6qmIweZh3ki+Cc9k1NXSAHrX+/heAc+J7h eDyA== X-Gm-Message-State: AJIora/ufrZKvj9h4M66OGZv97kUwsSxSRZSKNSNoFHhfhs/pnmLR0hR cHDbDeatGN7KK8O+Hg7tlpHekbVk9UZqJxQIC+EYTA== X-Received: by 2002:a5d:6ac4:0:b0:21b:a724:1711 with SMTP id u4-20020a5d6ac4000000b0021ba7241711mr13037659wrw.80.1656349469508; Mon, 27 Jun 2022 10:04:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yosry Ahmed Date: Mon, 27 Jun 2022 10:03:53 -0700 Message-ID: Subject: Re: [PATCH] mm: vmpressure: don't count userspace-induced reclaim as memory pressure To: Michal Hocko Cc: Shakeel Butt , Johannes Weiner , Roman Gushchin , Muchun Song , Andrew Morton , Matthew Wilcox , Vlastimil Babka , David Hildenbrand , Miaohe Lin , NeilBrown , Alistair Popple , Suren Baghdasaryan , Peter Xu , Linux Kernel Mailing List , 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, T_SCC_BODY_TEXT_LINE,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 Mon, Jun 27, 2022 at 5:31 AM Michal Hocko wrote: > > On Mon 27-06-22 02:39:49, Yosry Ahmed wrote: > [...] > > (a) Do not count vmpressure for mem_cgroup_resize_max() and > > mem_cgroup_force_empty() in v1. > > yes, unless you have a very good reason to change that. E.g. this has > been buggy and we have finally understood that. But I do not see any > indications so far. I don't have any bug reports. It makes sense that users do not expect vmpressure notifications when they resize the limits below the current usage, because it should be expected that reclaim will happen so receiving notifications here is redundant, and may be incorrectly perceived by a different user space thread as being under memory pressure. But I get your point that what the user sees as memory pressure or not could be different, and is probably already defined by the current behavior anyway, whether it makes sense or not. I can also see some userspace applications depending on this behavior in some way, either by handling that limit resize notification in a certain way or deliberately dropping it. Either way, making this change could throw them off. I don't expect any userspace applications to crash of course (because there are cases where they won't receive notifications, e.g. scanned < vmpressure_win), but perhaps it's not worth even risk misguiding them. So I agree that just because it doesn't make sense or is inconsistent with other definitions of behavior then we can make a visible change for userspace. I will drop the v1 changes in the next version anyway. Thanks! > > > (b) Do not count vmpressure (consequently, > > mem_cgroup_under_socket_pressure()) in v2 where psi is not counted > > (writing to memory.max, memory.high, and memory.reclaim). > > I can see clear arguments for memory.reclaim opt out for vmpressure > because we have established that this is not a measure to express a > memory pressure on the cgroup. > > Max/High are less clear to me, TBH. I do understand reasoning for PSI > exclusion because considering the calling process to be stalled and > non-productive is misleading. It just does its work so in a way it is > a productive time in the end. For the vmpressure, which measures how > hard/easy it is to reclaim memory why this should special for this > particular reclaim? > > Again, an explanation of the effect on the socket pressure could give a > better picture. Say that I somebody reduces the limit (hard/high) and it > takes quite some effort to shrink the consumption down. Should the > networking layer react to that in any way or should it wait for the > active allocation during that process to find that out? I am out of my depth here. Any answer on my side would be purely speculation at this point. Shakeel, can you help us here or tag some networking people? Thanks! > -- > Michal Hocko > SUSE Labs