Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6143248iog; Thu, 23 Jun 2022 12:14:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQvPV/KZoRs32dK+W+xYiawEACePspRukNhBYaLvUpUFPpbjfYJDFJmF0I+vtbtWvG6+v8 X-Received: by 2002:a17:903:2306:b0:16a:2fa4:9dad with SMTP id d6-20020a170903230600b0016a2fa49dadmr18203941plh.57.1656011677487; Thu, 23 Jun 2022 12:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011677; cv=none; d=google.com; s=arc-20160816; b=XTj+fiGVKodWM/Q0tWsw6mwYxfglW3xFdRyr+yymIv6mQp9h9u/Ygz5As46I/+NQh/ t2ZTrV8SItiae4t23Z1BfuAz/TJwyQZZNvue8fG0ml1ZYegDBIfn2Oai6D+blUH4k6XB qwQs4cD4I0B2PlNoaqbXhrRI2KO3DPXtvdTCZKj7ZRB4neDEs0pv5I1ffqV7bYYhfFUE iploov4lvXKUpXuw6oA9DSrctoGS66kmuYGYjEx7d8oab1c0nmUVE0kWX29o025li1kt rJvHjYxyBs5YkvEUiBvAhFgl1sJS2oyE4zlvofCtdAL/wdnujveqQi3rujTHhW4uxXzm nSKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x9l3R+KX6WOeiyi1xAcT40XEOunRcwBBALV27Yv1S0I=; b=B8Rjc7Jk5ZTQut2KaavwM5SX67TSj9Tg82yz9e49XybomdJ/vW6IaBrzGw2L0ZVatq 7Y/GmT7NOmXV/AQpheopFEptSlB+FBrZEAT3E074fZstFA4xhu4szlt0yp0FnfbVrexj EU4Ql6NUiMrM4fqDPwWTcndmHDXKaMyxzKuEbAaTaQrkcE/kHNes6OZtoPSHjGZ2NWZd UI+rvZNcBofvJdjv2T0cHPtW8WfmqT8lZdOUSSH6NTvmg3EXfvONMKDVb3XW04xeb3xZ 6XkErDymlmdlgAsTwKbPy3Uj4Fe0wbG2FdbcSkcco6sTfrp6mPYn3d+9FXBuvYvDrSZ9 XMUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=G2RfLflE; 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=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a17090adc8200b001ed1fde749fsi149516pjv.92.2022.06.23.12.14.26; Thu, 23 Jun 2022 12:14:37 -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=@suse.com header.s=susede1 header.b=G2RfLflE; 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=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234161AbiFWRb2 (ORCPT + 99 others); Thu, 23 Jun 2022 13:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234501AbiFWR2t (ORCPT ); Thu, 23 Jun 2022 13:28:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 910C87A6E4; Thu, 23 Jun 2022 10:04:26 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 97DB721B7E; Thu, 23 Jun 2022 17:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1656003864; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x9l3R+KX6WOeiyi1xAcT40XEOunRcwBBALV27Yv1S0I=; b=G2RfLflEoRnPfoa30BJzXST0CFeNzcKVmLSbuIwKMxDfMqVJeIrICEvbv+cQ3YhYXyigp6 BQqFOlQCFnxoJJ+VJv5ba4MclfCF/DVVoAxHCMmXkwMqUFyqfD8ZPUz5xlQS0d0qb0/JLN yrCJLNuSpzjv5cxbu0JLs8L+u9gXY7E= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id BA9A52C197; Thu, 23 Jun 2022 17:04:23 +0000 (UTC) Date: Thu, 23 Jun 2022 19:04:23 +0200 From: Michal Hocko To: Shakeel Butt Cc: Yosry Ahmed , 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 Subject: Re: [PATCH] mm: vmpressure: don't count userspace-induced reclaim as memory pressure Message-ID: References: <20220623000530.1194226-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu 23-06-22 09:42:43, Shakeel Butt wrote: > On Thu, Jun 23, 2022 at 9:37 AM Michal Hocko wrote: > > > > On Thu 23-06-22 09:22:35, Yosry Ahmed wrote: > > > On Thu, Jun 23, 2022 at 2:43 AM Michal Hocko wrote: > > > > > > > > On Thu 23-06-22 01:35:59, Yosry Ahmed wrote: > > [...] > > > > > In our internal version of memory.reclaim that we recently upstreamed, > > > > > we do not account vmpressure during proactive reclaim (similar to how > > > > > psi is handled upstream). We want to make sure this behavior also > > > > > exists in the upstream version so that consolidating them does not > > > > > break our users who rely on vmpressure and will start seeing increased > > > > > pressure due to proactive reclaim. > > > > > > > > These are good reasons to have this patch in your tree. But why is this > > > > patch benefitial for the upstream kernel? It clearly adds some code and > > > > some special casing which will add a maintenance overhead. > > > > > > It is not just Google, any existing vmpressure users will start seeing > > > false pressure notifications with memory.reclaim. The main goal of the > > > patch is to make sure memory.reclaim does not break pre-existing users > > > of vmpressure, and doing it in a way that is consistent with psi makes > > > sense. > > > > memory.reclaim is v2 only feature which doesn't have vmpressure > > interface. So I do not see how pre-existing users of the upstream kernel > > can see any breakage. > > > > Please note that vmpressure is still being used in v2 by the > networking layer (see mem_cgroup_under_socket_pressure()) for > detecting memory pressure. I have missed this. It is hidden quite good. I thought that v2 is completely vmpressure free. I have to admit that the effect of mem_cgroup_under_socket_pressure is not really clear to me. Not to mention whether it should or shouldn't be triggered for the user triggered memory reclaim. So this would really need some explanation. > Though IMO we should deprecate vmpressure altogether. Yes it should be really limited to v1. But as I've said the effect on mem_cgroup_under_socket_pressure is not really clear to me. It really seems the v2 support has been introduced deliberately. -- Michal Hocko SUSE Labs