Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1397472pxb; Fri, 1 Oct 2021 09:46:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye0eqW9izROVGgYxtRuQqiV1l1+XBHsTP6Hj2zY4Zgvw3C8BhHMuTzCpc1jrlhLv/UZOQC X-Received: by 2002:a17:902:bd05:b0:13d:e7cf:3b57 with SMTP id p5-20020a170902bd0500b0013de7cf3b57mr10506958pls.49.1633106791613; Fri, 01 Oct 2021 09:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633106791; cv=none; d=google.com; s=arc-20160816; b=nXgFmd6DbhYj6gr8DpTDuRDTVT41aiDDrrPwJeXLjVxlwO8WrFIXugGZ7f7DOYgoAQ 8qApU20q/e+TTnS0/3cRmQo49/DFndWPGJhR7poXRi22cMquz1B/SZ0EdYbPg9/7uFd4 vSRksGVwQ58xmbBS2SUvCk2/anFPOVrJCJGD5eYLu8zGR4Bl111ppxIa3piGYFY190rz gcEN8zmGwMbCzuWmm3ZaMWQHB3cE2G6FVtT8U3NvdZfpIFTP7g4uOzL/vgq6CAcbinp5 FS7G3d8evxIWS7u84K7Kcpe7jUAdkh+XlwiAdALAQLa8PhQfr/Ki5aA/KNIG0hn5bsRv xTGw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZkHivh3bEbZLhMTq7Ut+NDmzS9gwp+oTkR/9YPzzJdY=; b=c7jouKApxEL7E9RGLyFYpQ1r1d4fUBFV40ocS5Mhf//T+TaLJV9WtV6df49cEUhVwr Sp9VM+dbIud6VyIMdJ/CGRYJvICeFFvXu9QYFbgCpQ3fT94dszbQDKOz0e/lW3FVTMV8 /+D3JPfW8ZyVUoPxBV7fo2Lub+kR/qX21scc3vIqRsnpfNM/F8NrOlu+nX/GXmwe1lgJ DXdRz0d+sj/xYBE7VEFKQSJQuQeNFMSoUkXThC6uTXQW+JVYr556OjvYx12X4i06UviX iKSlewuluKQlowDkIe6sAtnWnhwPTX5LQ3bRK7KcKKDOA30Z6v1f58l+A0Tjx3eOjcA0 fs9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=qgS6vyKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l69si2783512pgd.206.2021.10.01.09.46.18; Fri, 01 Oct 2021 09:46:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=qgS6vyKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355215AbhJAQpo (ORCPT + 99 others); Fri, 1 Oct 2021 12:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbhJAQpn (ORCPT ); Fri, 1 Oct 2021 12:45:43 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BC82C061775 for ; Fri, 1 Oct 2021 09:43:59 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id q81so9762445qke.5 for ; Fri, 01 Oct 2021 09:43:59 -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:content-transfer-encoding:in-reply-to; bh=ZkHivh3bEbZLhMTq7Ut+NDmzS9gwp+oTkR/9YPzzJdY=; b=qgS6vyKL6kLFNLZNWng76Wz1ZCgI5yCPY1ptM5FkCkkzeKR9bCcYZrmKYSyLG6zXnS 5A6XyBlZo2yhX1Rwh6ZWvX3ETOVpFxY3G1i4IGuC/VXfO3XD2pIeyubl7Mc1PSNPBKpf RoS6nDFT5/q2zTAod+VGZM1N+docYgtPmtd6mlTBSsi5TNX4EVmMHzcGQS/jS7zrAA/J vwestgWBaoTJIwneEQMOv8NQQrrJZ3aosIAC69Hy6zmR6rCgeOUCpxEA849NBuL/yE0p XZrKmoAtu3QDNYRqKWAZQib+wTT48yfeQZyBur79kF+z77EKBZD/KBxkyH/T93wEg3py MuQQ== 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:content-transfer-encoding :in-reply-to; bh=ZkHivh3bEbZLhMTq7Ut+NDmzS9gwp+oTkR/9YPzzJdY=; b=cCM5o7t2wQRIUlGS9kXBFZ8kCGvtz1RiHQSf1/6/1u5gFbxwt9ZiRTeYj/dgmWnbVK IP9bnJP1TDx8OYC1/2SPqSqN9dSf87sWHt1tVuGClHGSezqJFeVVnnSMWYa6l5JP5AhZ QF4U5r8qnykLkFsRFNMPPQIWDqiE2RSvREsODksOe//TOrOYaXLbwU8uEh7ptVKAJidV 0J8jZuMjTQkShUSMVyXbDkq5JcrUnU5nSm0lt4LlCsBoFaCXHzOKfP+aN7llr3tqWsFN Xt2nIYc4p4+55Eodaxu2dCTCbkX9G3bGvXE4Qk4ZivpvQRMXeAueU+1V1mazu7hHmiHp QEMg== X-Gm-Message-State: AOAM5328dsG/uU8VNjVQpYOToqwffSnozeeItJokey3XpnA5PseyZUP1 NpMNt3c+TQYVC6XiTPDg6TNbdQ== X-Received: by 2002:a37:9f88:: with SMTP id i130mr10230773qke.478.1633106638551; Fri, 01 Oct 2021 09:43:58 -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 z19sm3544192qts.96.2021.10.01.09.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 09:43:57 -0700 (PDT) Date: Fri, 1 Oct 2021 12:43:56 -0400 From: Johannes Weiner To: =?utf-8?B?6KejIOWSj+aihQ==?= Cc: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: =?utf-8?B?5Zue5aSNOiBbUEFUQ0hdIG1tOnZt?= =?utf-8?Q?scan=3A_fix_extra_adjustmen?= =?utf-8?Q?t?= for lruvec's nonresident_age in case of reactivation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 02:27:24PM +0000, 解 咏梅 wrote: > But now, move_pages_to_lru didn't increase nonresident age for active rotation. > Back toinactive age, VM ONLY care about the pages left inactive lru, AKA activation and reclaiming. > Anyway reactivation is rare case, so whatever it contributes to nonresident age or not is ok to me. > > But I am interested the logic how to guess the pages will be referenced again in the future. > If active reactivation does matter to nonresident age. why not active rotation? But, currently it doesn't. Can you point me to the code you're referring to? Looking at move_pages_to_lru(), any pages with PageActive() set count toward the non-resident age. That means activations from the inactive list, as well as rotations on the active list, increase the nonresident age. As to your question which one is right: the original workingset patch was wrong not to count activations and reactivations. If we see a page referenced in memory, it means it's hotter than the page that's not refaulting -> nonresident age increses. So the code as it is now looks correct to me. Thanks