linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Yuanchu Xie <yuanchu@google.com>
Cc: Ivan Babrou <ivan@cloudflare.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	 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,  Jens Axboe <axboe@kernel.dk>,
	Michael Larabel <michael@michaellarabel.com>
Subject: Re: [PATCH 2/2] mm: support POSIX_FADV_NOREUSE for generic fadvise handler
Date: Thu, 22 Dec 2022 14:37:00 -0700	[thread overview]
Message-ID: <CAOUHufZhcJh8PdVtFuoOPWBWw_fWNAB61GndXoWjekYaubXTAQ@mail.gmail.com> (raw)
In-Reply-To: <20221222061341.381903-2-yuanchu@google.com>

On Wed, Dec 21, 2022 at 11:13 PM Yuanchu Xie <yuanchu@google.com> wrote:

Thanks for following up on this.

> POSIX_FADV_NOREUSE allows an application to specify that accesses to
> file data does not follow LRU and is used only once. Since 2.6.18 this
> is a no-op. We add FMODE_NOREUSE, checked in vma_has_locality to prevent
> LRU activation.

This needs to include what you plan to write on the man page.

A few questions to answer:
1. Does this flag work with accesses via FDs?
2. If there is a random or sequential file VMA, should the user choose
this flag or the VMA flag or both? Consider a) how those flags affect
readahead; b) their scopes, i.e., per VMA or per file.

Please also follow up with Jens to add this flag to fio.

Micheal reported that SVT-AV1 regressed with MGLRU, which is the only
real one [1]. The following not only fixes the regression but also
improves the baseline. Please follow up on that as well.

--- a/Source/App/EncApp/EbAppMain.c
+++ b/Source/App/EncApp/EbAppMain.c
@@ -115,6 +115,7 @@ void init_memory_file_map(EbConfig* config) {
             fseeko(config->input_file, curr_loc, SEEK_SET); // seek
back to that location
 #ifndef _WIN32
             config->mmap.fd = fileno(config->input_file);
+            posix_fadvise(config->mmap.fd, 0, 0, POSIX_FADV_NOREUSE);
 #endif
         }
         config->mmap.file_frame_it = 0;

[1] https://openbenchmarking.org/result/2209259-PTS-MGLRU8GB57


  reply	other threads:[~2022-12-22 21:37 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 [this message]
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
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=CAOUHufZhcJh8PdVtFuoOPWBWw_fWNAB61GndXoWjekYaubXTAQ@mail.gmail.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --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=michael@michaellarabel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).