linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olga Kornievskaia <aglo@umich.edu>
To: Anna Schumaker <schumaker.anna@gmail.com>
Cc: Trond Myklebust <trondmy@hammerspace.com>,
	"tigran.mkrtchyan@desy.de" <tigran.mkrtchyan@desy.de>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 0/3] NFS: Disable READ_PLUS by default
Date: Wed, 9 Dec 2020 12:39:20 -0500	[thread overview]
Message-ID: <CAN-5tyHJ0xChJxydZuqcJw3AZRDG708v2aSMSCuj3xc+57caDw@mail.gmail.com> (raw)
In-Reply-To: <CAFX2JfnMpEfqZFUYWQD9rV0VCvyYAejNWbNMUvW44fvhBeGhBw@mail.gmail.com>

On Wed, Dec 9, 2020 at 12:29 PM Anna Schumaker <schumaker.anna@gmail.com> wrote:
>
> On Wed, Dec 9, 2020 at 12:22 PM Olga Kornievskaia <aglo@umich.edu> wrote:
> >
> > On Wed, Dec 9, 2020 at 12:12 PM Trond Myklebust <trondmy@hammerspace.com> wrote:
> > >
> > > On Wed, 2020-12-09 at 12:07 -0500, Olga Kornievskaia wrote:
> > > > On Wed, Dec 9, 2020 at 11:59 AM Trond Myklebust
> > > > <trondmy@hammerspace.com> wrote:
> > > > >
> > > > > On Fri, 2020-12-04 at 15:00 -0500, Olga Kornievskaia wrote:
> > > > > > I object to putting the disable patch in, I think we need to fix
> > > > > > the
> > > > > > problem.
> > > > >
> > > > > I can't see the problem is fixable in 5.10. There are way too many
> > > > > changes required, and we're in the middle of the week of the last -
> > > > > rc
> > > > > for 5.10. Furthermore, there are no regressions introduced by just
> > > > > disabling the functionality, because READ_PLUS has only just been
> > > > > merged in this release cycle.
> > > > >
> > > > > I therefore strongly suggest we just send [PATCH 1/3] NFS: Disable
> > > > > READ_PLUS by default and then fix the rest in 5.11.
> > > >
> > > > Sure, but shouldn't there be more ifdefs inside of the xdr code to
> > > > turn it off completely?
> > >
> > > AFAICT, those functions are not called by anything else, so as long as
> > > the READ_PLUS client functionality is disabled, they should be
> > > harmless.
> >
> > Is it benign that in the normal read path sunrpc will be calling a new
> > function of xdr_realign_pages()? Non readplus code didn't have it.
>
> It should be. All I did was pull out some code from xdr_align_pages()
> and put it into a new function. `git show --diff-algorithm=histogram`
> says this is what I did:

Ok sounds good then. I just wanted to double check.

> diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> index 909920fab93b..d93bcad5ba9f 100644
> --- a/net/sunrpc/xdr.c
> +++ b/net/sunrpc/xdr.c
> @@ -997,10 +997,25 @@ __be32 * xdr_inline_decode(struct xdr_stream
> *xdr, size_t nbytes)
>  }
>  EXPORT_SYMBOL_GPL(xdr_inline_decode);
>
> +static void xdr_realign_pages(struct xdr_stream *xdr)
> +{
> +       struct xdr_buf *buf = xdr->buf;
> +       struct kvec *iov = buf->head;
> +       unsigned int cur = xdr_stream_pos(xdr);
> +       unsigned int copied, offset;
> +
> +       /* Realign pages to current pointer position */
> +       if (iov->iov_len > cur) {
> +               offset = iov->iov_len - cur;
> +               copied = xdr_shrink_bufhead(buf, offset);
> +               trace_rpc_xdr_alignment(xdr, offset, copied);
> +               xdr->nwords = XDR_QUADLEN(buf->len - cur);
> +       }
> +}
> +
>  static unsigned int xdr_align_pages(struct xdr_stream *xdr, unsigned int len)
>  {
>         struct xdr_buf *buf = xdr->buf;
> -       struct kvec *iov;
>         unsigned int nwords = XDR_QUADLEN(len);
>         unsigned int cur = xdr_stream_pos(xdr);
>         unsigned int copied, offset;
> @@ -1008,15 +1023,7 @@ static unsigned int xdr_align_pages(struct
> xdr_stream *xdr, unsigned int len)
>         if (xdr->nwords == 0)
>                 return 0;
>
> -       /* Realign pages to current pointer position */
> -       iov = buf->head;
> -       if (iov->iov_len > cur) {
> -               offset = iov->iov_len - cur;
> -               copied = xdr_shrink_bufhead(buf, offset);
> -               trace_rpc_xdr_alignment(xdr, offset, copied);
> -               xdr->nwords = XDR_QUADLEN(buf->len - cur);
> -       }
> -
> +       xdr_realign_pages(xdr);
>         if (nwords > xdr->nwords) {
>                 nwords = xdr->nwords;
>                 len = nwords << 2;
>
>
> >
> > >
> > > --
> > > Trond Myklebust
> > > Linux NFS client maintainer, Hammerspace
> > > trond.myklebust@hammerspace.com
> > >
> > >

  reply	other threads:[~2020-12-09 17:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 20:18 [PATCH 0/3] NFS: Disable READ_PLUS by default schumaker.anna
2020-12-03 20:18 ` [PATCH 1/3] " schumaker.anna
2020-12-03 20:18 ` [PATCH 2/3] NFS: Allocate a scratch page for READ_PLUS schumaker.anna
2020-12-03 20:27   ` Chuck Lever
2020-12-03 20:31     ` Anna Schumaker
2020-12-03 20:39       ` Trond Myklebust
2020-12-04 16:14         ` Chuck Lever
2020-12-03 20:18 ` [PATCH 3/3] SUNRPC: Keep buf->len in sync with xdr->nwords when expanding holes schumaker.anna
2020-12-04 15:47 ` [PATCH 0/3] NFS: Disable READ_PLUS by default Mkrtchyan, Tigran
2020-12-04 20:00   ` Olga Kornievskaia
2020-12-04 22:50     ` Mkrtchyan, Tigran
2020-12-07 15:26       ` Mkrtchyan, Tigran
2020-12-07 15:54         ` Mkrtchyan, Tigran
2020-12-08 12:39           ` Mkrtchyan, Tigran
2020-12-08 13:38             ` Anna Schumaker
2020-12-09 18:23               ` Mkrtchyan, Tigran
2020-12-09 16:59     ` Trond Myklebust
2020-12-09 17:07       ` Olga Kornievskaia
2020-12-09 17:12         ` Trond Myklebust
2020-12-09 17:22           ` Olga Kornievskaia
2020-12-09 17:28             ` Anna Schumaker
2020-12-09 17:39               ` Olga Kornievskaia [this message]
2020-12-09 17:32             ` Trond Myklebust
2020-12-09 17:40               ` Olga Kornievskaia

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=CAN-5tyHJ0xChJxydZuqcJw3AZRDG708v2aSMSCuj3xc+57caDw@mail.gmail.com \
    --to=aglo@umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumaker.anna@gmail.com \
    --cc=tigran.mkrtchyan@desy.de \
    --cc=trondmy@hammerspace.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).