All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@suse.de>, nfs@lists.sourceforge.net
Subject: Re: [PATCH 002 of 2] Avoid flush-when-locking when	interclient consistency not needed.
Date: Sun, 15 Apr 2007 21:49:08 -0400	[thread overview]
Message-ID: <4622D614.5030500@oracle.com> (raw)
In-Reply-To: <1176589265.6089.20.camel@heimdal.trondhjem.org>

[-- Attachment #1: Type: text/plain, Size: 3080 bytes --]

Trond Myklebust wrote:
> On Thu, 2007-03-08 at 10:03 +1100, Neil Brown wrote:
>>> You can argue for or against the need to invalidate caches when the user
>>> has specified "nolock" (it might be nice to add a Solaris-style "llock"
>>> alias to this one day, btw: nolock == local locking != no locking at
>>> all). We used to do this in early 2.4.x kernels, but that was changed.
>>> The reason is that locking is the only way of ensuring that the NFS
>>> cache is in sync with the server, and the "nolock" exception was
>>> breaking this.

Why not create a special fcntl for NFS files that invalidates cached 
data for that file?  That way, no matter what semantics a lock or unlock 
operation has, there is always a well-defined way to flush the page cache.

>> Yes, the name "nolock" does seem to have been unfortunate.  We had one
>> customer wondering why it wasn't producing an 'ENOLCK' error status.
>> We could create an alias.  "nonlm"?
> 
> I'd prefer "llock", simply because that mirrors the same option on
> Solaris.
> 
>> If you have chosen nocto,nolock, I cannot see any justification in
>> expecting any way of ensuring  the NFS cache is in sync with the
>> server except at unmount.
>>
>> However if you don't like it, that's fine.  It was just a "this might
>> be useful, what do you think" rather than "this is important".  The
>> other patch of the two was the real bugfix.  Did that pass muster?
>>
>> But I worry about adding an 'llock' option that was different from
>> 'nolock'.  How would you explain the difference in a way that didn't
>> confuse people?
> 
> Are we sure that 'llock' differs from 'nolock'? If Chuck is right, then
> we could simply make 'llock' set both the 'nolock' 'nocto' flags, and
> just document that. I'm not sure that he is, though. According to the
> manpage, Solaris documents
> 
>         nocto
>         
>                 No close-to-open consistency.
>         
>         llock
>         
>                 Local locking being used (no lock manager).

We should be careful here.  Solaris, IIRC, has different cache coherency 
semantics from Linux when a file is locked, so it might be difficult to 
compare mount options directly between Linux and Solaris.

Locked NFS files on Solaris get uncached I/O limited to 8KB.  I don't 
know exactly how llock changes this, but I suspect it probably doesn't 
change it at all.  Perhaps someone with Solaris NFS development 
experience can shed some light.

IMO an llock mount option is sorely missing on Linux... and I think it 
should disable the "automatic" cache flushing behaviors as well.  When 
local locking is used, clearly cache coherency with other clients isn't 
needed, and therefore invalidate-on-lock and flush-on-unlock semantics 
are not necessary and serve only to slow things down.

I don't necessarily disagree with Trond about requiring some mechanism 
for cache invalidation to be available.  However, as an aside, if the 
NFS cache invalidation logic is working overall, it really shouldn't 
ever be necessary for applications to trigger invalidation by hand.

[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 327 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
email;internet:chuck dot lever at nospam oracle dot com
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard


[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 140 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-04-16  1:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  5:40 [PATCH 000 of 2] A couple of possible nfs client patches NeilBrown
2007-03-06  5:40 ` [PATCH 001 of 2] Set meaningful value for fattr->time_start in readdirplus results NeilBrown
2007-04-14 22:13   ` Trond Myklebust
2007-04-15 23:35     ` Neil Brown
2007-04-16 15:23       ` Trond Myklebust
2007-03-06  5:40 ` [PATCH 002 of 2] Avoid flush-when-locking when interclient consistency not needed NeilBrown
2007-03-06 14:40   ` Trond Myklebust
2007-03-07 23:03     ` Neil Brown
2007-04-14 22:21       ` Trond Myklebust
2007-04-16  1:49         ` Chuck Lever [this message]
2007-04-16 14:12           ` Peter Staubach
2007-04-16 14:41           ` Trond Myklebust
2007-04-16 14:48             ` Peter Staubach
2007-03-06 14:57 ` [PATCH 000 of 2] A couple of possible nfs client patches 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=4622D614.5030500@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=neilb@suse.de \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /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.