From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE5EC43334 for ; Thu, 23 Jun 2022 16:50:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4BB9C8E0163; Thu, 23 Jun 2022 12:50:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 46A158E0144; Thu, 23 Jun 2022 12:50:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 331BB8E0163; Thu, 23 Jun 2022 12:50:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 253F28E0144 for ; Thu, 23 Jun 2022 12:50:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id EDCEA6087C for ; Thu, 23 Jun 2022 16:50:26 +0000 (UTC) X-FDA: 79610088852.15.07BAF9F Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by imf27.hostedemail.com (Postfix) with ESMTP id 737EF40037 for ; Thu, 23 Jun 2022 16:50:26 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id m184so266119wme.1 for ; Thu, 23 Jun 2022 09:50:26 -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=IyotFVIHbhwpabNYCGpU2td0gSap/Y9S4vgKOOyoLJk=; b=FrYaPn5yCP6c7XLE34Oe4aHh28I2+edN+azHdmB/Hm41HqxPPG50LlZclCjAXo/6sd sUji2HaPVj4NqIerdZV1Dq99mON5/WCMELiHVpfXmAwKM1hHBHG1C+ovvS4LPKdT0BHz MU+httuoGZN0A02Bd7UJMb4bVlLuJlrEMqr3r+eOFmOPuMHAP7R4lyJrGwSWuI5FSwxF 4HcDKCVCynBgWQuRcyr/73vXpiRCxe2AXuunChxGXu68Bey0VzUozDru4wS/+GO88u9X k8yG4gwL6fQWebAgqaipPE1moMjXv2dwUZBeCIlPcJ25UdJEqfrVImTleyGcA+DbBcjA teOQ== 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=IyotFVIHbhwpabNYCGpU2td0gSap/Y9S4vgKOOyoLJk=; b=V5riX3orUQK78lb9HTBRYlRy80EK26hAGCbjtpNSG+On0ISQiIbyZzlKWfh7GmBwDo 1updsy3lvjJtH4wEOS6/73Z5z0IexAXOuyhhO8z9Y9yYBT3GBEeZtONxr9QXCsaEWE0W z4Yd9oUtL2NYETEoFHeZ2+kI8elDEp38YnJZC/x8z4Zm+ZJ1KAZUJO5Qb4qBI0Oh6Ugz GbDwNhQujtJAQAPJjsMNED8twacPdFUS/6A83XsilE8DErUW3omCSVQDln2RiTSPETNr /hGvwrQ3JAh3DS0JaMYfeSpjhoD50vxfx8UJs8hCxRCiFbdCVoaG1Rk0tfqclxMLiSqp vt5g== X-Gm-Message-State: AJIora9otKYMQJ02R8LgN0PufDCSUPZ5UwarxDTjYmLPXQwZxz/36R1x Ftuwr9y2MmP6wQRHJF+noqMDzfaEJ7X8XC+zwmBLRg== X-Google-Smtp-Source: AGRyM1veKrdS63pvIE+ZqkDsx+2WUvC3Q147rHm2GTilmFfL/Eh0tVd/vlOO+xQfiDVYfU3UuSB9FmFFZe27Zk+zBa8= X-Received: by 2002:a05:600c:1906:b0:39c:7f82:3090 with SMTP id j6-20020a05600c190600b0039c7f823090mr5159188wmq.152.1656003025075; Thu, 23 Jun 2022 09:50:25 -0700 (PDT) MIME-Version: 1.0 References: <20220623000530.1194226-1-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Thu, 23 Jun 2022 09:49:48 -0700 Message-ID: Subject: Re: [PATCH] mm: vmpressure: don't count userspace-induced reclaim as memory pressure To: Shakeel Butt , Michal Hocko Cc: 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" ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=FrYaPn5y; spf=pass (imf27.hostedemail.com: domain of yosryahmed@google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656003026; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IyotFVIHbhwpabNYCGpU2td0gSap/Y9S4vgKOOyoLJk=; b=YYJ0HM/fghx1twegYNk/2DxIpouPPVCENF44/2M680I2jiUZIwy1LrRTVRfJ3RqdtPLovq WvogEB0sq68BGC7PPt4fiMkuQFGIMxpubSKRc8r9y0WGpWchrKNLrKoqn0R1AnUX87paZL Yi4+I3gFcFeBRTutzqyWBA1b4ht5kTg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656003026; a=rsa-sha256; cv=none; b=upyiHrIObgwAoqT38TlLFNjGCqzZDehR1QKw/Dsh54K0D8ALJoqmyUxCwYi8V8jY1m2LWh BSz96tg8H2t/9WsJhRLmSrSRsSwTKjuBhIxrU6RHgi2eRZHw7mNylwcecEWSBCIp+rN+jf cQ2h4ha8O97OjlwbFjx1giP1HqRy8Ro= X-Stat-Signature: bf44b93nnj6iam1ocf4d46m1i7hbeqq4 X-Rspamd-Queue-Id: 737EF40037 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=FrYaPn5y; spf=pass (imf27.hostedemail.com: domain of yosryahmed@google.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam02 X-HE-Tag: 1656003026-398307 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jun 23, 2022 at 9:42 AM 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. > > Though IMO we should deprecate vmpressure altogether. Thanks Shakeel for mentioning that, I was just about to. Although I agree vmpressure should be deprecated at some point, the current state is that memory.reclaim will give incorrect vmpressure signals. IMO psi and vmpressure (though legacy) both signify memory pressure and should both be consistent as to what is being accounted for.