All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: smfrench@gmail.com, nspmangalore@gmail.com,
	Jeff Layton <jlayton@kernel.org>,
	linux-cifs@vger.kernel.org, linux-cachefs@redhat.com
Subject: Re: [RFC PATCH] cifs: Transition from ->readpages() to ->readahead()
Date: Mon, 24 Jan 2022 15:33:08 +0000	[thread overview]
Message-ID: <Ye7GtNRgxkT9S6sG@casper.infradead.org> (raw)
In-Reply-To: <2255918.1643037281@warthog.procyon.org.uk>

On Mon, Jan 24, 2022 at 03:14:41PM +0000, David Howells wrote:
> Matthew Wilcox <willy@infradead.org> wrote:
> 
> > > Questions for Willy:
> > >  - Can we get a function to return the number of pages in a readahead
> > >    batch?
> > > 
> > >  - Can we get a function to commit a readahead batch?  Currently, this is
> > >    done when we call __readahead_batch(), but that means ractl->_nr_pages
> > >    isn't up to date at the point we need it to be.  However, we want to
> > >    check to see if the ractl is empty, then get server credits and only
> > >    *then* call __readahead_batch() as we don't know how big a batch we're
> > >    allowed till we have the credits.
> > 
> > If you insist on using the primitives in a way that nobody else uses
> > them, you're going to find they don't work.  What's wrong with the
> > way that FUSE uses them in fuse_readahead()?
> 
> You mean doing this?
> 
> 		nr_pages = readahead_count(rac) - nr_pages;
> 
> that would seem to indicate that the readahead interface is wrong.  Why should
> readahead_count() need correction?  I think I can see *why* the batching stuff
> is hidden, but it seems that the comment for readahead_count() needs to
> mention this if you aren't going to fix it.
> 
> Would it be possible to make readahead_count() do:
> 
> 	return rac->_nr_pages - rac->_batch_count;
> 
> maybe?

Yes, I think that would make sense.  Do we also need to change
readhead_length()?  It seems to me that it's only ever called once at
initialisation, so it should be possible to keep the two in sync.
Can you write & test such a patch?  I'll support it going upstream
(either by taking it myself or giving you a R-b to take it through your
tree).

  reply	other threads:[~2022-01-24 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 13:21 [RFC PATCH] cifs: Transition from ->readpages() to ->readahead() David Howells
2022-01-24 14:19 ` Matthew Wilcox
2022-01-24 15:14 ` David Howells
2022-01-24 15:33   ` Matthew Wilcox [this message]
2022-01-24 15:46   ` David Howells
2022-01-24 15:58     ` Matthew Wilcox
2022-01-24 16:25     ` David Howells
2022-01-25 14:41       ` Matthew Wilcox

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=Ye7GtNRgxkT9S6sG@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=smfrench@gmail.com \
    /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.