From: Matthew Wilcox <willy@infradead.org>
To: Azat.Nurgaliev@dlr.de
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Turn off readahead completely
Date: Mon, 25 Oct 2021 13:25:40 +0100 [thread overview]
Message-ID: <YXaiRCbm9pcG9pur@casper.infradead.org> (raw)
In-Reply-To: <066d9015e3c44c3a84eca5886d80bf04@dlr.de>
On Mon, Oct 25, 2021 at 11:55:03AM +0000, Azat.Nurgaliev@dlr.de wrote:
> Thank you for the reply, Matthew.
>
> I'm experimenting with GDAL and, in particular, working on improving the I/O performance of geo-applications.
> I wanted to get more control from the application over how the kernel handles I/O requests.
> But basically all the optimizations are hidden in readahead. Whatever requests are executed are all translated into readahead.
>
> It would be very useful to be able to evaluate the difference with more fine-grained control on the application side.
Ah! Then what you've done will be fine for your purpose.
What's going on here is that the kernel tries to read() from part of
the file that isn't cached. So it allocates a page of memory and then
does a page-sized readahead to that one page. It then waits for the
readahead to complete. If it fails (eg EIO), it'll try to read the
page using the filesystem's ->readpage operation.
While you see a readahead operation, it's not *really* a readahead
operation. It's doing the exact same read that you'd see if there
were no readahead operation.
> -----Original Message-----
> From: Matthew Wilcox <willy@infradead.org>
> Sent: Donnerstag, 21. Oktober 2021 15:28
> To: Nurgaliev, Azat <Azat.Nurgaliev@dlr.de>
> Cc: linux-fsdevel@vger.kernel.org
> Subject: Re: Turn off readahead completely
>
> On Thu, Oct 21, 2021 at 01:16:46PM +0000, Azat.Nurgaliev@dlr.de wrote:
> > Hello everyone,
> >
> > I need to turn readahead off completely in order to do my experiments.
> > Is there any way to turn it off completely?
> >
> > Setting /sys/block/<dev>/queue/read_ahead_kb to 0 causes readahead to become 4kb.
>
> That's entirely intentional. What experiment are you actually trying to perform?
prev parent reply other threads:[~2021-10-25 12:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 13:16 Turn off readahead completely Azat.Nurgaliev
2021-10-21 13:27 ` Matthew Wilcox
2021-10-25 11:55 ` Azat.Nurgaliev
2021-10-25 12:25 ` Matthew Wilcox [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=YXaiRCbm9pcG9pur@casper.infradead.org \
--to=willy@infradead.org \
--cc=Azat.Nurgaliev@dlr.de \
--cc=linux-fsdevel@vger.kernel.org \
/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.