All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Steve Dickson <SteveD@RedHat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	nfs@lists.sourceforge.net, Olaf Kirch <okir@suse.de>
Subject: Re: [PATCH] Access cache forgetting mode bits
Date: 01 Sep 2003 01:25:17 +0200	[thread overview]
Message-ID: <1062372316.2341.16.camel@bree.suse.de> (raw)
In-Reply-To: <3F525BA8.9020904@RedHat.com>

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

On Sun, 2003-08-31 at 22:33, Steve Dickson wrote:
> Hello,
> 
> I'm thinking there might even be a better way to cache these bits...
> 
> It seems the OS calls nfs_permission() to test each permission

Individually you mean? That's not at all the case in general.

> [...] even with Andreas patch's there are at least two rpcs for one access call....

No, two different, consecutice permission checks will result in two
RPCs.

It is possible to optimize another common case: Directory accesses are
seldom denied, and users are usually granted both r and x at once. The
attached patch optimizes that; it's the same pattern as in my first
patch. I'm in doubt whether this optimization is worth it, though.

For non-directories, I don't think a common enough case exists that
would deserve optimization.

> what if on the first access call, we get *all* of the access bits 
> from the
> server and cache them locally (i.e. in cache->mask). That way when 
> nfs_permission()
> is called again, all if the needed info is there... The attached patch 
> does just that
> and it really seems to cut down on the amount access rpc needed...
>
> Thoughts?

You have again attached your first, buggy patch.


Cheers,
-- 
Andreas Gruenbacher <agruen@suse.de>
SuSE Labs, SuSE Linux AG <http://www.suse.de/>


[-- Attachment #2: nfs-more-optimistic.diff --]
[-- Type: text/plain, Size: 660 bytes --]

Index: linux-2.4.21/fs/nfs/dir.c
===================================================================
--- linux-2.4.21.orig/fs/nfs/dir.c	2003-09-01 00:46:26.000000000 +0200
+++ linux-2.4.21/fs/nfs/dir.c	2003-09-01 01:09:27.000000000 +0200
@@ -1278,6 +1278,13 @@ nfs_permission(struct inode *inode, int 
 			if ((cache->mask & mask) == cache->mask)
 				goto out_cached;
 		}
+	} else if (S_ISDIR(mode)) {
+		int try_mask = mask | S_IROTH | S_IXOTH;
+		error = NFS_PROTO(inode)->access(inode, cred, try_mask);
+		if (!error || mask == try_mask) {
+			mask = try_mask;
+			goto rpc_done;
+		}
 	}
 	error = NFS_PROTO(inode)->access(inode, cred, mask);
 rpc_done:

  reply	other threads:[~2003-08-31 23:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-28 16:39 [PATCH] Access cache forgetting mode bits Steve Dickson
2003-08-28 21:51 ` Andreas Gruenbacher
2003-08-29 13:14   ` Steve Dickson
2003-08-31 20:33   ` Steve Dickson
2003-08-31 23:25     ` Andreas Gruenbacher [this message]
2003-09-01  3:22       ` Steve Dickson
2003-09-01  3:52         ` Trond Myklebust
2003-09-01 13:13           ` Steve Dickson

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=1062372316.2341.16.camel@bree.suse.de \
    --to=agruen@suse.de \
    --cc=SteveD@RedHat.com \
    --cc=nfs@lists.sourceforge.net \
    --cc=okir@suse.de \
    --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.