All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Marshall <hubcap@omnibond.com>
To: David Howells <dhowells@redhat.com>, Mike Marshall <hubcap@omnibond.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [RFC PATCH v2] implement orangefs_readahead
Date: Sat, 24 Apr 2021 21:43:20 -0400	[thread overview]
Message-ID: <CAOg9mSTwNKPdRMwr_F87YCeUyxT775pBd5WcewGpcwSZFVz5=w@mail.gmail.com> (raw)
In-Reply-To: <1612829.1618587694@warthog.procyon.org.uk>

>> What happens if bytes_remaining < PAGE_SIZE?

I think on a call where that occurs, new_len won't get set
and readahead_expand won't get called. I don't see how that's
not correct, but I question me more than I question you :-) ...

>> what happens if bytes_remaining % PAGE_SIZE != 0

I think bytes_remaining % PAGE_SIZE worth of bytes won't get read on
that call, but that the readahead callout keeps getting called until all
the bytes are read? After you asked this, I thought about adding 1 to
new_len in such cases, and did some tests that way, it seems to me like it
works out as is.

>> I wonder if you should use iov_length(&iter)

iov_length has two arguments. The first one would maybe be iter.iov and
the second one would be... ?

>> should you cache inode->i_size lest it change under you due to truncate

That seems important, but I can't return an error from the void
readahead callout. Would I react by somehow returning the pages
back to their original condition, or ?

Anywho... I see that you've force pushed a new netfs... I think you
have it applied to a linus-tree-of-the-day on top of 5.12-rc4?
I have taken these patches from
git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git (netfs-lib)

0001-iov_iter-Add-ITER_XARRAY.patch
0002-mm-Add-set-end-wait-functions-for-PG_private_2.patch
0003-mm-filemap-Pass-the-file_ra_state-in-the-ractl.patch
0004-fs-Document-file_ra_state.patch
0005-mm-readahead-Handle-ractl-nr_pages-being-modified.patch
0006-mm-Implement-readahead_control-pageset-expansion.patch
0007-netfs-Make-a-netfs-helper-module.patch
0008-netfs-Documentation-for-helper-library.patch
0009-netfs-mm-Move-PG_fscache-helper-funcs-to-linux-netfs.patch
0010-netfs-mm-Add-set-end-wait_on_page_fscache-aliases.patch
0011-netfs-Provide-readahead-and-readpage-netfs-helpers.patch
0012-netfs-Add-tracepoints.patch
0013-netfs-Gather-stats.patch
0014-netfs-Add-write_begin-helper.patch
0015-netfs-Define-an-interface-to-talk-to-a-cache.patch
0016-netfs-Add-a-tracepoint-to-log-failures-that-would-be.patch
0017-fscache-cachefiles-Add-alternate-API-to-use-kiocb-fo.patch

... and added them on top of Linux 5.12-rc8 and added my
readahead patch to that.

Now I fail one extra xfstest, I fail generic/075, generic/112,
generic/127, generic/263 and generic/438. I haven't found an
obvious (to me) problem with my patch and I can't claim to understand
everything that is going on in the patches I have of yours...

I'll keep looking...

-Mike

On Fri, Apr 16, 2021 at 11:41 AM David Howells <dhowells@redhat.com> wrote:
>
> In orangefs_readahead():
>
>         loff_t bytes_remaining = inode->i_size - readahead_pos(rac);
>         loff_t pages_remaining = bytes_remaining / PAGE_SIZE;
>
> What happens if bytes_remaining < PAGE_SIZE?  Or even what happens if
> bytes_remaining % PAGE_SIZE != 0?
>
>         if ((ret = wait_for_direct_io(ORANGEFS_IO_READ, inode,
>                         &offset, &iter, readahead_length(rac),
>                         inode->i_size, NULL, NULL, file)) < 0)
>
> I wonder if you should use iov_length(&iter) rather than
> readahead_length(rac).  They *should* be the same.
>
> Also, should you cache inode->i_size lest it change under you due to truncate?
>
> David
>

  reply	other threads:[~2021-04-25  1:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31 22:25 [RFC PATCH] implement orangefs_readahead Mike Marshall
2021-02-01 13:08 ` Matthew Wilcox
2021-02-02  3:32   ` Mike Marshall
2021-03-13 15:31     ` [RFC PATCH v2] " Mike Marshall
2021-03-17  3:04       ` Mike Marshall
2021-03-24 11:10     ` David Howells
2021-03-27  2:55       ` Mike Marshall
2021-03-27  3:50         ` Matthew Wilcox
2021-03-27  8:31         ` David Howells
2021-03-27 13:56           ` Matthew Wilcox
2021-03-27 15:40             ` Mike Marshall
2021-03-27 15:56               ` Matthew Wilcox
2021-03-28  3:04                 ` Mike Marshall
2021-03-29  1:51                   ` Mike Marshall
2021-03-29  9:37                   ` David Howells
2021-03-29 23:25                     ` Mike Marshall
     [not found]                       ` <3726695.1617284551@warthog.procyon.org.uk >
2021-04-13 15:08                         ` David Howells
2021-04-16 14:36                           ` Mike Marshall
2021-04-16 15:14                             ` Matthew Wilcox
2021-04-25  1:51                               ` Mike Marshall
2021-04-16 15:41                           ` David Howells
2021-04-25  1:43                             ` Mike Marshall [this message]
2021-04-25  7:49                             ` David Howells
2021-04-26 14:53                               ` Mike Marshall
2021-04-26 19:01                                 ` Mike Marshall
2021-04-26 20:01                                 ` David Howells
2021-04-26  8:37                             ` David Howells
2021-04-01 13:42                     ` David Howells
2021-04-08 20:39                       ` Mike Marshall

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='CAOg9mSTwNKPdRMwr_F87YCeUyxT775pBd5WcewGpcwSZFVz5=w@mail.gmail.com' \
    --to=hubcap@omnibond.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@infradead.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.