From: Benny Halevy <bhalevy@panasas.com>
To: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfsd4: complete enforcement of 4.1 op ordering
Date: Tue, 27 Apr 2010 18:03:14 +0300 [thread overview]
Message-ID: <4BD6FCB2.4020805@panasas.com> (raw)
In-Reply-To: <20100424001034.GA7176@fieldses.org>
On Apr. 24, 2010, 3:10 +0300, "J. Bruce Fields" <bfields@citi.umich.edu> wrote:
> On Fri, Apr 23, 2010 at 07:13:44PM -0400, J. Bruce Fields wrote:
>> On Fri, Apr 23, 2010 at 05:24:11PM -0400, J. Bruce Fields wrote:
>>> On Thu, Apr 22, 2010 at 10:48:31AM -0400, J. Bruce Fields wrote:
>>>> On Thu, Apr 22, 2010 at 10:32:23AM -0400, J. Bruce Fields wrote:
>>>>> Enforce the rules about compound op ordering.
>>>>>
>>>>> Motivated by implementing RECLAIM_COMPLETE, for which the client is
>>>>> implicit in the current session, so it is important to ensure a
>>>>> succesful SEQUENCE proceeds the RECLAIM_COMPLETE.
>>>>
>>>> The other problem here is that while we have a reference count on the
>>>> session itself preventing it from going away till the compound is done,
>>>> I don't see what prevents the associated clientid from going away.
>>>>
>>>> To fix that, and to be more polite to 4.0 clients, I think we want to
>>>> also add a client pointer to the compound_state structure, keep count of
>>>> the number of compounds in progress which reference that client, and not
>>>> start the client's expiry timer until we've encoded the reply to the
>>>> compound.
>>>
>>> Benny--I coded up a simple (possibly incorrect) implementation of this,
>>> and then remembered that this was more or less what your
>>> state-lock-reduction-prep patch series did. Do you have a more recent
>>> version of those patches?
>>
>> One possible problem with that approach: mark_for_renew() can fail (if
>> the client is already expired), without telling the caller.
>>
>> You then end up with an odd situation, continuing to process the rest of
>> the compound normally, while your session belongs to a client that's
>> already expired.
>>
>> Perhaps it would be better to mark the client for possible renewal the
>> moment it (or some stateid, sessionid, or other object that refers to
>> it) is looked up?
>
> Also: a single "RENEW" state won't suffice when multiple outstanding
> compounds reference the same client, in which case you want only the
> last (not the first) to complete to do the renewal. So I think we want
> a count of outstanding compounds referencing the client, so that we can
> do the renewal when the count goes to zero.
True. My patchset sort of did that on SEQUENCE, though not under the
sessionid_lock. If the client is expired atomically with updating
all sessions referring to it under that lock we can refcount it for
renewal on nfsd4_get_session (always called under sessionid_lock),
next nfsd4_put_session should be moved under the same lock and there
the "use count" can be decremented and the client can be renewed
when no session is actively using it.
Benny
>
> --b.
next prev parent reply other threads:[~2010-04-27 15:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-22 14:32 [PATCH 1/2] nfsd4: complete enforcement of 4.1 op ordering J. Bruce Fields
2010-04-22 14:32 ` [PATCH 2/2] nfsd4: implement reclaim_complete J. Bruce Fields
2010-04-22 14:48 ` [PATCH 1/2] nfsd4: complete enforcement of 4.1 op ordering J. Bruce Fields
2010-04-22 15:03 ` J. Bruce Fields
2010-04-23 21:24 ` J. Bruce Fields
2010-04-23 23:13 ` J. Bruce Fields
2010-04-24 0:10 ` J. Bruce Fields
2010-04-27 15:03 ` Benny Halevy [this message]
2010-04-27 14:40 ` Benny Halevy
2010-04-27 15:01 ` J. Bruce Fields
2010-04-27 15:44 ` Benny Halevy
2010-04-27 16:36 ` J. Bruce Fields
2010-04-27 15:46 ` Benny Halevy
2010-04-27 16:12 ` J. Bruce Fields
2010-04-27 16:22 ` Benny Halevy
2010-04-27 16:34 ` J. Bruce Fields
2010-04-27 16:44 ` Benny Halevy
2010-04-27 18:10 ` J. Bruce Fields
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=4BD6FCB2.4020805@panasas.com \
--to=bhalevy@panasas.com \
--cc=bfields@citi.umich.edu \
--cc=linux-nfs@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox