Re: Turn off readahead completely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 25, 2021 at 11:55:03AM +0000, Azat.Nurgaliev@xxxxxx 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@xxxxxxxxxxxxx> 
> Sent: Donnerstag, 21. Oktober 2021 15:28
> To: Nurgaliev, Azat <Azat.Nurgaliev@xxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Subject: Re: Turn off readahead completely
> 
> On Thu, Oct 21, 2021 at 01:16:46PM +0000, Azat.Nurgaliev@xxxxxx 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?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux