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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 779ECC433F5 for ; Fri, 1 Oct 2021 16:44:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C01076124D for ; Fri, 1 Oct 2021 16:44:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C01076124D 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 4439B940118; Fri, 1 Oct 2021 12:44:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F30E9400E4; Fri, 1 Oct 2021 12:44:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E352940118; Fri, 1 Oct 2021 12:44:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 1DCB09400E4 for ; Fri, 1 Oct 2021 12:44:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C86253A2AD for ; Fri, 1 Oct 2021 16:43:59 +0000 (UTC) X-FDA: 78648440598.03.499FF02 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by imf12.hostedemail.com (Postfix) with ESMTP id 5132C100069D for ; Fri, 1 Oct 2021 16:43:59 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id 194so9713343qkj.11 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=lORp2VsFNuzJNWDwGz1M5cRNRk7PDOVtRrCRhQmKeAIUBW+wfaah5ob/ennApAlPgs tGCwUcLtx8ir1FtZGdb2/6QEC1QXzKdMIp6CZvkosYsqcV6BMRtPDHDQ47zW/bGCfvRG tdf4Gc8eLQPYPxSj9EktvYixZFA7LfiCiTQVJUo6N4h8xDz37BlSU02O3URRfNLieq4H yrTqg7vyr1q/w28jjcN9IK3XX19PptqkvyxR0S0M6gzOQSvDA83NaxHnuwZDJ+8yBD23 QZoigx4/J+Nf+3xJGZoN8D91iESF6vFvcLCV+a6TDC+biFTyuNW+UaU4z5EY5zzBPsTM sO0w== X-Gm-Message-State: AOAM530JljXv0OUIVaQqvSJ4L6sv0do1dxQCfwA7KsibrgJrC1Q/9tnx aVje0oCzBkKxQoY5Ag8ZUy4yNw== X-Google-Smtp-Source: ABdhPJx9jAT1FbSD62wMql0yoUa1KdOwj8mED7wKfNAaarrNlESlHbQmkdDPUmEyIS3rHawgOy42OQ== 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 In-Reply-To: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=qgS6vyKL; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.173 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5132C100069D X-Stat-Signature: i6yijphcbhaf17woihfb3mrgkntn7w9g X-HE-Tag: 1633106639-262712 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.039260, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Sep 22, 2021 at 02:27:24PM +0000, =E8=A7=A3 =E5=92=8F=E6=A2=85 wr= ote: > But now, move_pages_to_lru didn't increase nonresident age for active r= otation. > Back toinactive age, VM ONLY care about the pages left inactive lru, AK= A activation and reclaiming. > Anyway reactivation is rare case, so whatever it contributes to nonresi= dent age or not is ok to me. >=20 > 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 r= otation? 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