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 19862C433F5 for ; Tue, 15 Feb 2022 16:13:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35E376B0078; Tue, 15 Feb 2022 11:13:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30C776B007B; Tue, 15 Feb 2022 11:13:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1ADBC6B007D; Tue, 15 Feb 2022 11:13:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id 0C0BE6B0078 for ; Tue, 15 Feb 2022 11:13:52 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B70858249980 for ; Tue, 15 Feb 2022 16:13:51 +0000 (UTC) X-FDA: 79145510262.30.56354A8 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf12.hostedemail.com (Postfix) with ESMTP id EDFB44001B for ; Tue, 15 Feb 2022 16:13:50 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id z15so1234591qtx.13 for ; Tue, 15 Feb 2022 08:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ypn/aYhmXOciMlfqAueEjzIefCRey5nIsCwsmgIaFyY=; b=M05Qq9KLA8RA/K4rgZh8Lyc5eMuEySX+Ry8WzMfSzm5+VZy2e572WzK5dx7cb9f/s2 GcX0Uukp2v8wej6E1jLCuPNVOXZpVrqdwy9JNOJjadsWI3IU/34PPNDVdnu80pyOhVcs dKaSNObBW0j+55nBBPpEao2XIqvb7u12hlmcND1Mdk+YBSiZoLsDA4vicbMcAkyNumyk DhYryeQROUrahMCawnYnQHjjaASneqPFZpBTRoC2bxoA1o0Gs5z4da/PCYTDjWa9Uq35 XJe9Zt+iNzaH0vssCa847XcKyINklOusgsgty68boxvD5NTnJXq3IMlbxcLbFtje+ogh A5nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ypn/aYhmXOciMlfqAueEjzIefCRey5nIsCwsmgIaFyY=; b=x6eL+JYZoKSRPBZtY8BHpiCC49vvAlnMMbQQYOQWy1n5vofGweK+ezxjVzF911dTb7 WlKZTxQgg5fswyYWRk7pAYXjNvt7pSsYk6vzXPMOUEybuID12ZeiQ7h1NXIkGj3cH/Kh EVZ5Z0hVUi8/IM1GsQMQE3/7Y2Rlv62K/YCPeQLE69lLb1mEupGG8rVKA2OeO8+fAS+M TRjjghIGJpPhFVSTf4mP0x3dIL1eQZIsZMCSxJCRhMkq/W/m1YyQPmS9pQGeI3tClO8V gumDyLb/TronCWTDtIzsnDtyArB2+jFvj0L6kIaw02ibWIplkAPvZYFRS8heuiKXk+AU z6Fw== X-Gm-Message-State: AOAM533+dvYt+VjhWBDgtej/4B7k+lW2gUimquW9BngYDKucRc/QK1Qn 8bCqcYvMeOWD3twN8ahGCuhlRw== X-Google-Smtp-Source: ABdhPJzckpK/aLbVPcqxjj0MTWY9sCyxas2zreD1jK0ipt/37kTFObu882WaGo6NHke162vUMLOVbw== X-Received: by 2002:ac8:5d8a:: with SMTP id d10mr3252911qtx.279.1644941630211; Tue, 15 Feb 2022 08:13:50 -0800 (PST) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id s9sm16641251qki.101.2022.02.15.08.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 08:13:49 -0800 (PST) Date: Tue, 15 Feb 2022 11:13:48 -0500 From: Johannes Weiner To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, CGEL , Minchan Kim , Joonsoo Kim , Yu Zhao Subject: Re: [PATCH] mm: page_io: fix psi memory pressure error on cold swapins Message-ID: References: <20220214214921.419687-1-hannes@cmpxchg.org> <20220214144805.fa389f495fdfb07b40526f70@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214144805.fa389f495fdfb07b40526f70@linux-foundation.org> X-Stat-Signature: cnguctnimoheb5eiz5aus3ogy6datra3 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EDFB44001B Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=M05Qq9KL; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.181 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspam-User: X-HE-Tag: 1644941630-934526 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 Mon, Feb 14, 2022 at 02:48:05PM -0800, Andrew Morton wrote: > On Mon, 14 Feb 2022 16:49:21 -0500 Johannes Weiner wrote: > > > Once upon a time, all swapins counted toward memory pressure[1]. Then > > Joonsoo introduced workingset detection for anonymous pages and we > > gained the ability to distinguish hot from cold swapins[2][3]. But we > > failed to update swap_readpage() accordingly, and now we account > > partial memory pressure in the swapin path of cold memory. > > > > Not for all situations - which adds more inconsistency: paths using > > the conventional submit_bio() and lock_page() route will not see much > > pressure - unless storage itself is heavily congested and the bio > > submissions stall. ZRAM and ZSWAP do most of the work directly from > > swap_readpage() and will see all swapins reflected as pressure. > > > > Restore consistency by making all swapin stall accounting conditional > > on the page actually being part of the workingset. > > Does this have any known runtime effects? If not, can we > hazard a guess? hm, how about this paragrah between "not for all situations" and "restore consistency": IOW, a workload doing cold swapins could see little to no pressure reported with on-disk swap, but potentially high pressure with a zram or zswap backend. That confuses any psi-based health monitoring, load shedding, proactive reclaim, or userspace OOM killing schemes that might be in place for the workload.