From: Olga Kornievskaia <aglo@umich.edu>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 5/7] NFS: Convert lookups of the open context to RCU
Date: Fri, 28 Sep 2018 15:55:46 -0400 [thread overview]
Message-ID: <CAN-5tyGrjjGKG5KoDAgzLrnnzjGUqmf1iUD_AM=wbX8bD5Jk-g@mail.gmail.com> (raw)
In-Reply-To: <CAN-5tyGBufKA6Bn1AsB7yLviVGr5SHGyRc4z4hrKF-hScTrQXg@mail.gmail.com>
On Fri, Sep 28, 2018 at 3:10 PM Olga Kornievskaia <aglo@umich.edu> wrote:
>
> On Fri, Sep 28, 2018 at 2:54 PM Trond Myklebust <trondmy@hammerspace.com> wrote:
> >
> > On Fri, 2018-09-28 at 14:31 -0400, Olga Kornievskaia wrote:
> > > On Fri, Sep 28, 2018 at 1:50 PM Trond Myklebust <trondmy@gmail.com>
> > > wrote:
> > > >
> > > > On Fri, 2018-09-28 at 12:54 -0400, Olga Kornievskaia wrote:
> > > > > Also shouldn't this be a bug fix for 4.19 and also go to stable?
> > > >
> > > > It wasn't really intended as a bugfix because I wasn't aware that
> > > > there
> > > > was a bug to fix in the first place. I assume the modification to
> > > > nfs4_state_find_open_context() to cause it to look for an open
> > > > context
> > > > with a READ/WRITE open mode first is what fixes the bug. Is that
> > > > the
> > > > case?
> > >
> > > I don't think so. nfs4_state_find_open_context() never gets calls
> > > during the run of this test case. This function is called during the
> > > reclaim on an open. In delegation recall the opens are not reclaimed,
> > > it is just reclaiming the locks.
> > >
> > > Actually, when I undo this piece of the patch, I can make it fail
> > > again.
> > >
> > > @@ -1027,10 +1027,7 @@ void nfs_inode_attach_open_context(struct
> > > nfs_open_context *ctx)
> > > struct nfs_inode *nfsi = NFS_I(inode);
> > >
> > > spin_lock(&inode->i_lock);
> > > - if (ctx->mode & FMODE_WRITE)
> > > - list_add(&ctx->list, &nfsi->open_files);
> > > - else
> > > - list_add_tail(&ctx->list, &nfsi->open_files);
> > > + list_add_tail_rcu(&ctx->list, &nfsi->open_files);
> > > spin_unlock(&inode->i_lock);
> > > }
> > > EXPORT_SYMBOL_GPL(nfs_inode_attach_open_context);
> > >
> > > It looks like the placement in the list matters? Any ideas why?
> >
> > Currently, the list is ordered so that writeable open contexts are
> > always found first. The reason is that when traversing the list during
> > server reboot recovery, we want to ensure that we reclaim any write
> > delegations on the file first so that we can cache all subsequent opens
> > and locks of that file.
> >
> > A delegation return requires us to recover all cached state, so it must
> > reclaim both OPEN and LOCK state. It is not, however, expected to
> > depend on the open context list ordering, since there can be no further
> > caching.
> > IOW: no, I don't see why your bug would depend on the list order unless
> > some part of the recovery is actually failing.
>
> Ok thanks. Need to fix the lack of OPEN reclaim.
Wait, why are we suppose to reclaim the open state when we have a
valid open stateid? We don't have any cached opens that server doesn't
know about. RFC7530 says "if the file has other open reference", I
think the emphasis is on "other". I don't believe we need to be
sending anything besides the locks to the server. Then I'm back to
square one.
>
> > --
> > Trond Myklebust
> > Linux NFS client maintainer, Hammerspace
> > trond.myklebust@hammerspace.com
> >
> >
next prev parent reply other threads:[~2018-09-29 2:21 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 19:23 [PATCH 0/7] Misc NFS + pNFS performance enhancements Trond Myklebust
2018-09-05 19:23 ` [PATCH 1/7] pNFS: Don't zero out the array in nfs4_alloc_pages() Trond Myklebust
2018-09-05 19:23 ` [PATCH 2/7] pNFS: Don't allocate more pages than we need to fit a layoutget response Trond Myklebust
2018-09-05 19:23 ` [PATCH 3/7] NFS: Convert lookups of the lock context to RCU Trond Myklebust
2018-09-05 19:23 ` [PATCH 4/7] NFS: Simplify internal check for whether file is open for write Trond Myklebust
2018-09-05 19:23 ` [PATCH 5/7] NFS: Convert lookups of the open context to RCU Trond Myklebust
2018-09-05 19:23 ` [PATCH 6/7] NFSv4: Convert open state lookup to use RCU Trond Myklebust
2018-09-05 19:24 ` [PATCH 7/7] NFSv4: Convert struct nfs4_state to use refcount_t Trond Myklebust
2018-09-28 16:34 ` [PATCH 5/7] NFS: Convert lookups of the open context to RCU Olga Kornievskaia
2018-09-28 16:54 ` Olga Kornievskaia
2018-09-28 17:49 ` Trond Myklebust
2018-09-28 18:31 ` Olga Kornievskaia
2018-09-28 18:53 ` Trond Myklebust
2018-09-28 19:10 ` Olga Kornievskaia
2018-09-28 19:55 ` Olga Kornievskaia [this message]
2018-09-28 20:07 ` Trond Myklebust
2018-09-28 20:19 ` Olga Kornievskaia
2018-09-28 20:38 ` Trond Myklebust
2018-10-03 18:38 ` Olga Kornievskaia
2018-10-04 15:22 ` Trond Myklebust
2018-10-04 15:49 ` Olga Kornievskaia
2018-10-04 16:13 ` Trond Myklebust
2018-10-04 16:31 ` Olga Kornievskaia
2018-10-04 16:42 ` Trond Myklebust
2018-10-04 18:51 ` Olga Kornievskaia
2018-10-03 22:05 ` [PATCH 2/7] pNFS: Don't allocate more pages than we need to fit a layoutget response NeilBrown
2018-09-05 19:33 ` [PATCH 0/7] Misc NFS + pNFS performance enhancements Chuck Lever
2018-09-05 20:36 ` Trond Myklebust
2018-09-07 15:44 ` Chuck Lever
2018-09-10 1:35 ` Trond Myklebust
2018-09-10 16:14 ` Chuck Lever
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-5tyGrjjGKG5KoDAgzLrnnzjGUqmf1iUD_AM=wbX8bD5Jk-g@mail.gmail.com' \
--to=aglo@umich.edu \
--cc=linux-nfs@vger.kernel.org \
--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).