Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp592231pxb; Tue, 15 Feb 2022 23:07:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2YvIlRNhKGLAvCmCJueDNbfV0q4U22n/xkcXqQJIq6VWpHlIRraVlasBi7umaCQjDgLnj X-Received: by 2002:a17:90a:6001:b0:1bb:83e8:1694 with SMTP id y1-20020a17090a600100b001bb83e81694mr214113pji.127.1644995271059; Tue, 15 Feb 2022 23:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995271; cv=none; d=google.com; s=arc-20160816; b=Cx2amXcnl7lLlekEcqajowwRV9Vh4D1LtEIdE2aJ1nxL01De1FGSJKy72NaZBPQX0n lFPUcJTHGD3R1AlKg0I1sSwI/m03DI+PkoCb30GkQLlp7sVbUfgimAhxM7dZubcTdQJN 7Cvh7Ug7U8OTm41c5YSjIyWYABtwfURHNiD96NpQkKtPs9xQ6lOWAUyqGAw0E/fs7f0/ n7zJeU+yh33PFvNZ9kAC9F1HSpWRH4iKkQ7MMxEvmpYcGAP4RggBCVO6iGl59RGvlt6q pmPqvvf7KrZSKXiJvo3MYQGsW1JKMIZ5hMzQrol+Ob79ziz0vwXeMQxyQuliWneHbFjV cGvg== 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:sender:dkim-signature; bh=3joERcoQKId/zOkoKD6SJoazN6O1PmNm0Tu+J2P9YSI=; b=GqwE+1GEOv0Cvv41AWGXhA2+n0NYZUndJt4Cz04ewKfNnOb7Q19NdWwCvBhg6x4xfB SNKrswpmmH5tLv6G9n6FXB2m59Re5ngnpMgt8qKkP4CIOiGRRp594CYTrtLAGMG18LHy 6BbYbBkoHj5Pyq5yRaPhOXbdPatCMvoKnKBqMRNw9O+Yy7l27CP803waxOF+a9F/uY6B dZZeJQvu76k78jMClLC0O5hG3YDxgB36DdcZ96MWSJ8JClwTFxLHKi8xWKUU6W6+5OUQ uTEbOLPYN40sAR/iP6onKpkb6d4MZVIyXRy7EM4Wf1+rfoBop3/CSKOUcRHXqmRGVMFw YAyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YgYgbr0K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lb12si22014253pjb.131.2022.02.15.23.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:07:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YgYgbr0K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F04F24F12; Tue, 15 Feb 2022 22:44:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242665AbiBORoc (ORCPT + 99 others); Tue, 15 Feb 2022 12:44:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242669AbiBORo2 (ORCPT ); Tue, 15 Feb 2022 12:44:28 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACBBE687F for ; Tue, 15 Feb 2022 09:44:18 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id y18so13637024plb.11 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=3FXcoQL161CAfZ+ji6KcWs6gC3RKUcb5EU4v9pr8YS4EeDnRFeQv4iBixvAYbbjwzx Prmx2cNu7VbWNmI/LJYfqrKMHVmwSZFRhcNjv2L0LuB3S0PNFk/WBSShu7XsKukiRn/4 ucocAm/7ibEhM6h012il33FnARkPLqOUXYZ08RlN8su3SYe7Ktg6Ub8iKId1ZUdBPAzj 5XVoco+jFptXgiATiPsNdgaJjztyX7ExEhSKK3OkIlVi8qSOys4ZzGSDJyVjS/jTD3jC xYnA/U83RQeDZC0/FeRC/hfkggNtTrO+X1sqWtNiFI6RGm70jUY3K+RhK24iqMyUVSCv C/3w== X-Gm-Message-State: AOAM531SnM6dlhVYcmMjNu63v0NdsVUpbfG/7Lchjawv1aSSMCzfMZtV lagGwFrmBLD2XziYJ55eonH24rW6Ogo= 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) Sender: Minchan Kim 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 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