All of lore.kernel.org
 help / color / mirror / Atom feed
* Turn off readahead completely
@ 2021-10-21 13:16 Azat.Nurgaliev
  2021-10-21 13:27 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Azat.Nurgaliev @ 2021-10-21 13:16 UTC (permalink / raw)
  To: linux-fsdevel

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.

Thanks,
Azat

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Turn off readahead completely
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2021-10-21 13:27 UTC (permalink / raw)
  To: Azat.Nurgaliev; +Cc: linux-fsdevel

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Turn off readahead completely
  2021-10-21 13:27 ` Matthew Wilcox
@ 2021-10-25 11:55   ` Azat.Nurgaliev
  2021-10-25 12:25     ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Azat.Nurgaliev @ 2021-10-25 11:55 UTC (permalink / raw)
  To: willy; +Cc: linux-fsdevel

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.

-----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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Turn off readahead completely
  2021-10-25 11:55   ` Azat.Nurgaliev
@ 2021-10-25 12:25     ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2021-10-25 12:25 UTC (permalink / raw)
  To: Azat.Nurgaliev; +Cc: linux-fsdevel

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-25 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.