fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Isawan Millican <linux@isawan.net>, fio@vger.kernel.org
Subject: Re: fadvise_hint behavior unclear from documentation
Date: Sat, 18 Sep 2021 20:31:04 -0600	[thread overview]
Message-ID: <692c86eb-8c9b-5475-5eab-4b988725da18@kernel.dk> (raw)
In-Reply-To: <769eb00b-fa01-a9f1-4fcc-09f4f7bbce38@isawan.net>

On 9/18/21 4:46 PM, Isawan Millican wrote:
> Hi,
> 
> I was using fio and noticed that the throughput was lower than expected for
> random reads to a small file; I would expect it to be entirely cached in
> memory. The issue seems to be because fadvise_hint=0 is not behaving as
> documented as POSIX_FADV_DONTNEED is being called.
> This might be the intended bahavior as the program is flushing the pages
> to purely test IO throughput
> 
> If the current behaviour is intentional, is there an existing flag that 
> could
> provide the desired functionality? Essentially I'd like to test the IO
> throughput of various file sizes without bypassing the page cache to see the
> effects of caching.

Just set invalidate=0 and fio won't invalidate the address space page
cache for the files or devices used.

You seem to have snipped most of the cmdhelp for fadvise_hint:

        fadvise_hint: Use fadvise() to advise the kernel on IO pattern
                type: string (opt=bla)
             default: 1
        valid values: 0          Don't issue fadvise/madvise
                    : 1          Advise using fio IO pattern
                    : random     Advise using FADV_RANDOM
                    : sequential Advise using FADV_SEQUENTIAL

which tells you that it's about telling the kernel if you're doing
random or sequential IO (this will impact read-ahead, for example).
Invalidation is kept separate.

-- 
Jens Axboe


      reply	other threads:[~2021-09-19  2:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 22:46 fadvise_hint behavior unclear from documentation Isawan Millican
2021-09-19  2:31 ` Jens Axboe [this message]

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=692c86eb-8c9b-5475-5eab-4b988725da18@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=linux@isawan.net \
    /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).