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 982DDC433F5 for ; Mon, 14 Feb 2022 22:48:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D03446B0075; Mon, 14 Feb 2022 17:48:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB2FA6B007B; Mon, 14 Feb 2022 17:48:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B79F66B007D; Mon, 14 Feb 2022 17:48:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id A53766B0075 for ; Mon, 14 Feb 2022 17:48:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 58A5F8CA5F for ; Mon, 14 Feb 2022 22:48:10 +0000 (UTC) X-FDA: 79142875140.08.0CB2C19 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id C143D180005 for ; Mon, 14 Feb 2022 22:48:09 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0404DB80861; Mon, 14 Feb 2022 22:48:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8137DC340E9; Mon, 14 Feb 2022 22:48:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1644878886; bh=1UJ2OiyXpKMgePt9yHkVQT3f1I3liwRx9crIh4pbdh8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TTulpw//oeAq9LWoFuC5gP5jQL2rV71B/LvOaSfLDYi5+JcxWtSosJsWToeGzIZd6 YQY431PW1zqwb3wodRMXYkRQjnnxW3prhbhOn02wz4ZvstFcgEvnMSScLhYhA+0VzT gM6bugtF7m/BgrDrZ+3TXZxgJl/DswnHz+GuN4Y8= Date: Mon, 14 Feb 2022 14:48:05 -0800 From: Andrew Morton To: Johannes Weiner 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: <20220214144805.fa389f495fdfb07b40526f70@linux-foundation.org> In-Reply-To: <20220214214921.419687-1-hannes@cmpxchg.org> References: <20220214214921.419687-1-hannes@cmpxchg.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C143D180005 X-Stat-Signature: zzcq4w8rz6yhnce4dxe6y6myfzsnatcm X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="TTulpw//"; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1644878889-117439 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, 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?