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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4101FC433F5 for ; Tue, 21 Sep 2021 14:46:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C84960F6E for ; Tue, 21 Sep 2021 14:46:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9C84960F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2773E94000C; Tue, 21 Sep 2021 10:46:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 224C8940007; Tue, 21 Sep 2021 10:46:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1144894000C; Tue, 21 Sep 2021 10:46:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F287E940007 for ; Tue, 21 Sep 2021 10:46:21 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A3DE9181EBF1C for ; Tue, 21 Sep 2021 14:46:21 +0000 (UTC) X-FDA: 78611856162.37.82327B3 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by imf02.hostedemail.com (Postfix) with ESMTP id 353F87001A23 for ; Tue, 21 Sep 2021 14:46:21 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id f22so55455842qkm.5 for ; Tue, 21 Sep 2021 07:46:20 -0700 (PDT) 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=g/5wAGdIqDpepTm7AaXMwRb0JTwB/CszwhWs0V5grd8=; b=NuHGGC3mqlBsZ+ZpSWNZPC1w/E33K2K8fAaK0xBoRCZMYLE4cjdFvkZs1lYKM8zSDm nfhYfdgvaYeX/ricJZ9AOMj7cEHU9VBmCk2nvryu09FbdruGAQHaEXDqb3K4YHlSi0HE WSZAq/UdcEkC0uvqZLzbjxQDljFVXZjRjYh8u66PdHZdA4KZfcxIMx9yjQ6VBKQP2QQr gJ1FPBrxO3Jvyc2E02pJLiOdhDKCAlxtL02gWZVs0kMSl6ol8rvL8thJPZIjvPp2U9nx +g9cw2em/g898qDkK93AFNS6v8lNxIz3uxmCi/1629Xr4TPKlIgdOib1ZSM0rYGTRGiU L9gQ== 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=g/5wAGdIqDpepTm7AaXMwRb0JTwB/CszwhWs0V5grd8=; b=CPZ1UmDhc/WIfMYpiCwd9TVJ0f3xOt/i6Oi1sG76JBWtqrwCsBlmvmFIf41nYpTYQA NuHOuA1l09zFyaIqsyjl6u8M8RRS9macf8c/OizvJMsfYKkeNkY8WQ0n/mZ3rEwX6Su+ uyS6CgrsYS1OvWc2F5UmCwNbqjscUEjvzYA4Lta76SXbjzUd2pxCe+QqANDYompcrJRv cc/l4CmYurc7PQvewvp6dB1PSuKydsg+wzrFr1wkjZ9SnGeEyeKdQY4z9Eg9Q4aI175L 34lQtzuT5WmiWnnU0ZjGPFqR4WQ5sKOG0ZL848j/SNfA9RUtgLj0zuGPsMsdfp9gjKrB RkCA== X-Gm-Message-State: AOAM531E9P8qAbSSYpzesWUSA2gFnoVR9HhmR5CImK987cswxVl/QJBk odO/qyurojroEpLRgunrQaEMwg== X-Google-Smtp-Source: ABdhPJxNONS0+e09ljyIMzt9Ynqr49RIx46nyIbG9/UH6wkZDmaa4KKv66f/2fhbvmqH5MqMcHV3bw== X-Received: by 2002:a05:620a:1aa5:: with SMTP id bl37mr29154787qkb.84.1632235579371; Tue, 21 Sep 2021 07:46:19 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id q14sm13619711qkl.44.2021.09.21.07.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 07:46:18 -0700 (PDT) Date: Tue, 21 Sep 2021 10:48:19 -0400 From: Johannes Weiner To: Yongmei Xie Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm:vmscan: fix extra adjustment for lruvec's nonresident_age in case of reactivation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 6wynregb8yg4xkni1pp79m3rdbokgkqm Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=NuHGGC3m; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf02.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.174 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 353F87001A23 X-HE-Tag: 1632235581-238071 X-Bogosity: Ham, tests=bogofilter, spamicity=0.157256, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, Sep 19, 2021 at 11:25:09PM +0800, Yongmei Xie wrote: > Before commit #31d8fcac, VM didn't increase nonresident_age (AKA inactive age for > file pages) in shrink_page_list. When putback_inactive_pages was converged with > move_pages_to_lru, both shrink_active_list and shrink_page_list use the same > function to handle move pages to the appropriate lru under lru lock's protection. > > At those day, VM didn't increase nonresident_age for second chance promotion. > Commit #31d8fcac fix the problem. Definitely, we should account the activation > for second chance. But move_pages_to_lru is used in reactivation in active lru > as well for protecting code section. So I suggest to add another variable to > tell whether reactivation or not. This looks incorrect to me. We *should* count reactivations/rotations on the active list toward nonresident age. The nonresident age tracks the number of in-memory references in order to later calculate the (minimum) reuse distance of refaulting pages. If a page on the active list gets reactivated due to a reference, that reference contributes to the distance of yet-to-refault pages.