All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yuanchu Xie <yuanchu@google.com>,
	Ivan Babrou <ivan@cloudflare.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Steven Barrett <steven@liquorix.net>,
	Brian Geffon <bgeffon@google.com>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Suren Baghdasaryan <surenb@google.com>,
	Arnd Bergmann <arnd@arndb.de>, Peter Xu <peterx@redhat.com>,
	Hugh Dickins <hughd@google.com>,
	Gaosheng Cui <cuigaosheng1@huawei.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm: add vma_has_locality()
Date: Thu, 22 Dec 2022 12:44:35 -0700	[thread overview]
Message-ID: <CAOUHufZpbfTCeqteEZt5k-kFZh3-++Gm0Wnc0-O=RFT-K9kzkw@mail.gmail.com> (raw)
In-Reply-To: <20221222104937.795d2a134ac59c8244d9912c@linux-foundation.org>

On Thu, Dec 22, 2022 at 11:49 AM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> On Wed, 21 Dec 2022 22:13:40 -0800 Yuanchu Xie <yuanchu@google.com> wrote:
>
> > From: Yu Zhao <yuzhao@google.com>

This works; suggested-by probably works even better, since I didn't do
the follow-up work.

> > Currently in vm_flags in vm_area_struct, both VM_SEQ_READ and
> > VM_RAND_READ indicate a lack of locality in accesses to the vma. Some
> > places that check for locality are missing one of them. We add
> > vma_has_locality to replace the existing locality checks for clarity.
>
> I'm all confused.  Surely VM_SEQ_READ implies locality and VM_RAND_READ
> indicates no-locality?

Spatially, yes. But we focus more on the temporal criteria here, i.e.,
the reuse of an area within a relatively small duration. Both the
active/inactive LRU and MGLRU rely on this.

VM_SEQ_READ, while being a special case of spatial locality, fails the
temporal criteria. VM_RAND_READ fails both criterias, obviously.

Once an area passes the temporal criteria, MGLRU additionally exploits
spatial locality by lru_gen_look_around(), which is also touched in
this patch. This part is good to know but not really relevant here.

  reply	other threads:[~2022-12-22 19:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22  6:13 [PATCH 1/2] mm: add vma_has_locality() Yuanchu Xie
2022-12-22  6:13 ` [PATCH 2/2] mm: support POSIX_FADV_NOREUSE for generic fadvise handler Yuanchu Xie
2022-12-22 21:37   ` Yu Zhao
2022-12-22  6:38 ` [PATCH 1/2] mm: add vma_has_locality() Yuanchu Xie
2022-12-22 18:49 ` Andrew Morton
2022-12-22 19:44   ` Yu Zhao [this message]
2022-12-22 20:29     ` Andrew Morton
2022-12-30 21:59       ` Yu Zhao
2022-12-22 19:52 ` Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOUHufZpbfTCeqteEZt5k-kFZh3-++Gm0Wnc0-O=RFT-K9kzkw@mail.gmail.com' \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bgeffon@google.com \
    --cc=cuigaosheng1@huawei.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=ivan@cloudflare.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleksandr@natalenko.name \
    --cc=peterx@redhat.com \
    --cc=steven@liquorix.net \
    --cc=surenb@google.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuanchu@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.