Re: [RFC PATCH] implement orangefs_readahead

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

 



On Sun, Jan 31, 2021 at 05:25:02PM -0500, Mike Marshall wrote:
> I wish I knew how to specify _nr_pages in the readahead_control
> structure so that all the extra pages I need could be obtained
> in readahead_page instead of part there and the rest in my
> open-coded stuff in orangefs_readpage. But it looks to me as
> if values in the readahead_control structure are set heuristically
> outside of my control over in ondemand_readahead?

That's right (for now).  I pointed you at some code from Dave Howells
that will allow orangefs to enlarge the readahead window beyond that
determined by the core code's algorithms.

> [root@vm3 linux]# git diff master..readahead
> diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
> index 48f0547d4850..682a968cb82a 100644
> --- a/fs/orangefs/inode.c
> +++ b/fs/orangefs/inode.c
> @@ -244,6 +244,25 @@ static int orangefs_writepages(struct
> address_space *mapping,
> 
>  static int orangefs_launder_page(struct page *);
> 
> +/*
> + * Prefill the page cache with some pages that we're probably
> + * about to need...
> + */
> +static void orangefs_readahead(struct readahead_control *rac)
> +{
> +       pgoff_t index = readahead_index(rac);
> +       struct page *page;
> +
> +       while ((page = readahead_page(rac))) {
> +               prefetchw(&page->flags);
> +               put_page(page);
> +               unlock_page(page);
> +               index++;
> +       }
> +
> +       return;
> +}

This is not the way to do it.  You need to actually kick off readahead in
this routine so that you get pipelining (ie the app is working on pages
0-15 at the same time the server is getting you pages 16-31).  I don't
see much support in orangefs for doing async operations; everything
seems to be modelled on "submit an I/O and wait for it to complete".

I'm happy to help out with pagecache interactions, but adding async
support to orangefs is a little bigger task than I'm willing to put
significant effort into right now.



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

  Powered by Linux