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:58:43 +0000	[thread overview]
Message-ID: <Ye7Ms67MA0kycc/x@casper.infradead.org> (raw)
In-Reply-To: <2270964.1643039187@warthog.procyon.org.uk>

On Mon, Jan 24, 2022 at 03:46:27PM +0000, David Howells wrote:
> Matthew Wilcox <willy@infradead.org> wrote:
> 
> > > 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).
> 
> It seems I also have a problem with readahead_index() needing compensation
> too.  I'm guessing that's more of a problem, however, as I think that's
> expected to refer to the beginning of the current batch.

Well, that's the problem isn't it?  You're expecting to mutate the state
and then refer to its previous state instead of its current state,
whereas the other users refer to the current state instead of the
previous state.  Can't you pull readahead_index() out of the ractl
ahead of the mutation?

  reply	other threads:[~2022-01-24 15:58 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
2022-01-24 15:46   ` David Howells
2022-01-24 15:58     ` Matthew Wilcox [this message]
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=Ye7Ms67MA0kycc/x@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.