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 45A5BC433F5 for ; Tue, 15 Feb 2022 17:44:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF9996B0078; Tue, 15 Feb 2022 12:44:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA82D6B007B; Tue, 15 Feb 2022 12:44:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6F776B007D; Tue, 15 Feb 2022 12:44:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 9940A6B0078 for ; Tue, 15 Feb 2022 12:44:19 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 61F078249980 for ; Tue, 15 Feb 2022 17:44:19 +0000 (UTC) X-FDA: 79145738238.22.FB7BF09 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf02.hostedemail.com (Postfix) with ESMTP id 0949280013 for ; Tue, 15 Feb 2022 17:44:18 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id a11-20020a17090a740b00b001b8b506c42fso3789016pjg.0 for ; Tue, 15 Feb 2022 09:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3joERcoQKId/zOkoKD6SJoazN6O1PmNm0Tu+J2P9YSI=; b=YgYgbr0K4iZYpvIS0mXDtaeLL5DkSUCJg76i9XndkniN82i0jhOg45lRnPuba3VZSi iPWHWcekY5egS/liL2WXby6spXFfIOPy5teIbH9WsnHq9QXWeR+DZaPV9JNPzduF7RXC Yqv+3QTuYMS5CQft4+nDdttei44BaXqIjxT6nxDRi9f248r1ltEOdjH7mcLKB8BigmZa kiYcIzl9SO3y6ilmvkOmfAU9hmVrjFehYf9aQJg7EkPXZf9i0WPKYrTa4EcIuDMfCvM5 AJajgeDFnbieAzAl3nuMgas8Gl4MocplB/MXArAN35vkglG7r6ApWYbFHKKIykUVG+Z4 UOrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=3joERcoQKId/zOkoKD6SJoazN6O1PmNm0Tu+J2P9YSI=; b=ke4I3D9uLO9qc0QJytvEwhlaoj1H2PRqh9hpIBP6HgMWw+gN9BkATofY3nGweuJ3/T hJ/fGL9jK6xAfABpJHjMF0LAQABxtBX1OAneu+Ob+KmYeLyieTVQN5P3vabHErmyqdOK 0XRHuaGQ7DJ6X/RbxOwXewI4A366fAc/Aok2Ti/sVdKfwjFFc17DBFmQEA2RB00tlu9r OmJTEVV1AWPXzpMxXyrXn+H2YKgWSfqs3MbmKQHhT7R6ZtvXN+g5UU2kCD/czjTOajtg 8tm0gkozuZyOC/4B3pY1i8pAV+TQ3Lidq6I+ZGqWMLlOYgCFeP6lwBDZqKWD8nI4QMoY pB7g== X-Gm-Message-State: AOAM530KeFEvXkzDHOIGobOBLUTH+dxikNFndGh9dbHbOVWF9T2rZeE/ x5pwOO5NccKZ9pPGp21glao= X-Google-Smtp-Source: ABdhPJx6dNpICXka2jir8VDYSzAtQ50eldeKKX8qrCPLzXa60bSBip/upGFW8GLYek1NzR0S3ZfuFw== X-Received: by 2002:a17:90b:2243:b0:1b9:e528:5496 with SMTP id hk3-20020a17090b224300b001b9e5285496mr5610729pjb.240.1644947057841; Tue, 15 Feb 2022 09:44:17 -0800 (PST) Received: from google.com ([2620:15c:211:201:6806:5397:3a20:7881]) by smtp.gmail.com with ESMTPSA id s5sm2878098pfd.66.2022.02.15.09.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 09:44:17 -0800 (PST) Date: Tue, 15 Feb 2022 09:44:15 -0800 From: Minchan Kim To: Johannes Weiner Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, CGEL , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214214921.419687-1-hannes@cmpxchg.org> X-Rspamd-Queue-Id: 0949280013 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YgYgbr0K; spf=pass (imf02.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-Stat-Signature: z9dbxydizztc1dmcc5dadiuyy3ucdabc X-Rspamd-Server: rspam11 X-HE-Tag: 1644947058-694588 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 04:49:21PM -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. > > [1] commit 937790699be9 ("mm/page_io.c: annotate refault stalls from swap_readpage") > [2] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") > [3] commit cad8320b4b39 ("mm/swap: don't SetPageWorkingset unconditionally during swapin") > > Reported-by: CGEL > Signed-off-by: Johannes Weiner Acked-by: Minchan Kim