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 4F6F8C433F5 for ; Thu, 6 Oct 2022 11:09:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 595A28E0002; Thu, 6 Oct 2022 07:09:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 545DE8E0001; Thu, 6 Oct 2022 07:09:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E5ED8E0002; Thu, 6 Oct 2022 07:09:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2A25C8E0001 for ; Thu, 6 Oct 2022 07:09:29 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id EA2A21604CD for ; Thu, 6 Oct 2022 11:09:28 +0000 (UTC) X-FDA: 79990253616.21.9B9A8EB Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf18.hostedemail.com (Postfix) with ESMTP id 8AFF01C000F for ; Thu, 6 Oct 2022 11:09:28 +0000 (UTC) Received: by mail-ej1-f41.google.com with SMTP id r17so3749448eja.7 for ; Thu, 06 Oct 2022 04:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=vp2wpq4Jz8ArZProXZxAX/lnGwivqanwg1NiG25siJw=; b=mcKxJACfN7qsrvE7rXE70Vtw2lApOwgIFVBphcic3OfhcKLdO+lOP5gTdSzZaEbG/Y S/2RaaAxQG+gZ/m+2dsnd4KzxbH1cdRPWsw94uGUJR7EPUJCBw1pt0J6qAioU9LexIWG 77/ReS3MDJq84rJGIObVdPwSuANtgSp0tKFNw17hZDslBjyGdKLMtG367slNJJgEPG2j 25M2ME3PQQCkkZms//fzHA0DbOKnQaxdC5mCYohJBxD4QA2nEEFelN9rhwgJ9IZ7Mh4o HeeA0Kuxa7LBeXkkBO3vW0C0eFktm+xjPHP2IPrejC0ygyEDCZBn1rxbV26AcKopWemw xDLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vp2wpq4Jz8ArZProXZxAX/lnGwivqanwg1NiG25siJw=; b=211GYOmHivtwWSzqq0gS0m2hvo42neLDL/G3uedCuqDiSRrubwyOc61VzthkTS6ANB XAHXWJteV1w/1GbVwtwMIo2qGG65D+ACEiaeiKvsfYduw0cwcAvwWHwRN3FBEffbVAXQ 8mZgq4nFVWbYwIidSYq1/gXKEfZuWKOT86S7gtPYdrlYwi5d+/diGN3ss8Wi+iD2xJZg cOsiGFpY0MWtbH1zCaeLzbxNUx4zfkPY8HwMiLE3+UidgswVAbilnD9lCvajdy8fLHuO RppARWGJPpiDcU2CTY/fTNaYWPXIWlwW62heAesV1c/mjGiQConVNbTv6oZBOfAkac4z v12g== X-Gm-Message-State: ACrzQf3rezeCdxeJrQ8MYhDJFhyLaxWG8GIYUybz/PxQ4dUDtabXwM/T F2k3xrLFGkq8NiYHdQRc/SloxH0T753QELtPwKOfDm/Gsgg= X-Google-Smtp-Source: AMsMyM6tlizlpAMI/vzKU/zBMSWG1fel6+QVvv4T/NjdIpmyA1QV/MFI2lBeOJVarzBkLvtmnmYwvYDKthnZ7RCjziE= X-Received: by 2002:a17:907:7287:b0:783:ad45:27aa with SMTP id dt7-20020a170907728700b00783ad4527aamr3377525ejc.99.1665054566813; Thu, 06 Oct 2022 04:09:26 -0700 (PDT) MIME-Version: 1.0 From: Jin Huang Date: Thu, 6 Oct 2022 04:09:15 -0700 Message-ID: Subject: How to track the LRU pages access? To: linux-mm@kvack.org Content-Type: multipart/alternative; boundary="000000000000fc93d505ea5bb936" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665054568; a=rsa-sha256; cv=none; b=hGju7sphFRPdbP0aXhvBofnmr2/w5awrsov3892qY226aRoJgNlcdph35JlyrvTyf8TpDz eiuPuc28WMmTqcENdANwsCU8pyB9Jvg2gTkxZ8HipcFFo9O/zymgqfc06HQqcQc7brs+Zr itOn/fpQkl09ewIZxY5TyaC7kBy7xj4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mcKxJACf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of andy.jinhuang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=andy.jinhuang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665054568; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=vp2wpq4Jz8ArZProXZxAX/lnGwivqanwg1NiG25siJw=; b=A+i469kMWRLieu4p3QOGLCBPM5tQg0FH8egA8QEGL/bGIlJKyKqRusY3rsmMlkjOE8EtVI y0ne/kB1E/B7+/4QnRIY4ahALDMGfAuN5G6WSQUnOqA0z6D6/VHprk6X7eWJ2zoswWylA8 A9ZRqn981geWG0+Y3W2EbXylmvXGFRM= Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mcKxJACf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of andy.jinhuang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=andy.jinhuang@gmail.com X-Rspam-User: X-Stat-Signature: 4tuiky153rufdq3ccnbio4f33wm6f1o4 X-Rspamd-Queue-Id: 8AFF01C000F X-Rspamd-Server: rspam03 X-HE-Tag: 1665054568-961837 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000080, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000fc93d505ea5bb936 Content-Type: text/plain; charset="UTF-8" Hi, everyone My name is Jin Huang, a graduate student interested in Linux Kernel. Hope I ask the question in the right place. I want to track the access activity of the pages in the LUR lists, including Anon/File active/inactive lists, the access times and stuff. (1) I find a function very interesting and promising, void folio_mark_accessed(struct folio *folio), in mm/swap.c in linux v6.0. Looking at the comment, seems it is used to mark the page access for the LRU algorithm. (2) I try to use some conditions, like folio_test_lru, folio_test_anon, folio_test_active, to collect the access information for anon_[in/]activelist, file_[in/]activelist. (3) From this experiment, I found I could not get the information I want. Seems there are always, even I do not run any application, many many file pages access(for system) coming into folio_mark_accessed(); Even though I run some large memory-intensive application workload, the information of the anon pages I get from this function is so limited, only about 200 page access for a more than 50G memory consumption workload. I want to ask/confirm folio_mark_accessed() does not track every page access as I expect, right? Do you have some suggestions if I want to track the LRU page access information? Especially for the application pages. Thank You Best Jin Huang --000000000000fc93d505ea5bb936 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, everyone
My name is Jin Huang, a gradua= te student interested in Linux Kernel.
Hope I ask the question in= the right place.

I want to track the access activ= ity of the pages in the LUR lists, including Anon/File active/inactive list= s, the access times and stuff.

(1) I find a functi= on very interesting and promising,=C2=A0void folio_mark_accessed(struct fol= io *folio), in mm/swap.c in linux v6.0.
Looking at the comment, s= eems it is used to mark the page access for the LRU algorithm.
(2= ) I try to use some conditions, like=C2=A0folio_test_lru,=C2=A0folio_test_a= non,=C2=A0folio_test_active, to collect the access information for anon_[in= /]activelist, file_[in/]activelist.=C2=A0=C2=A0
(3) From this exp= eriment, I found I could not get the information I want.=C2=A0
Seems there are always, even I do not run any application, man= y many file pages access(for system) coming into folio_mark_accessed();Even though I run some large memory-intensive application workload, the i= nformation of the anon pages I get from this function is so limited, only a= bout 200 page access for a more than 50G memory consumption workload.
<= br>
I want to ask/confirm folio_mark_accessed() does not track ev= ery page access as I expect, right?=C2=A0
Do you have some sugges= tions if I want to track the LRU page access information? Especially for th= e application pages.

<= div>
Thank You
Best
Jin Huang
--000000000000fc93d505ea5bb936--