From: "J. Bruce Fields" <bfields@fieldses.org>
To: Krishna Kumar2 <krkumar2@in.ibm.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 0/1] nfsd: Improve NFS server performance
Date: Thu, 5 Feb 2009 15:24:01 -0500 [thread overview]
Message-ID: <20090205202401.GH9200@fieldses.org> (raw)
In-Reply-To: <OF46E14C36.93250375-ON65257554.0050CEC8-65257554.005328DC@in.ibm.com>
On Thu, Feb 05, 2009 at 08:38:19PM +0530, Krishna Kumar2 wrote:
> Hi Bruce,
>
> Thanks for your comments (also please refer to REV2 of patch as that is
> much simpler).
Yes, apologies, I only noticed I had a later vesion after responding to
the wrong one....
> > I think of open and lookup as fairly fast, so I'm surprised this
> > makes a great difference; do you have profile results or something
> > to confirm that this is in fact what made the difference?
>
> Beyond saving the open/lookup times, the cache is updated only once.
> Hence no lock plus update is required for subsequent reads - the code
> does a single lock on every read operation instead of two. The time to
> get the cache is approximately the same for old vs new code; but in
> the new code we get file/dentry and svc_exp.
>
> I used to have counters in nfsd_open - something like dbg_num_opens,
> dbg_open_jiffies, dgb_close_jiffies, dbg_read_jiffies,
> dgb_cache_jiffies, etc. I can reintroduce those debugs and get a run
> and see how those numbers looks like, is that what you are looking
> for?
I'm not sure what you mean by dbg_open_jiffies--surely a single open of
a file already in the dentry cache is too fast to be measurable in
jiffies?
> > When do items get removed from this cache?
>
> At the first open, the item is kept at the end of a global list (which is
> manipulated by the new daemon). After some jiffies are over, the daemon
> goes through the list till it comes to the first entry that has not
> expired; and frees up all the earlier entries. If the file is being used,
> it is not freed. If file is used after free, a new entry is added to the
> end of the list. So very minimal list manipulation is required - no sorting
> and moving entries in the list.
OK, yeah, I just wondered whether you could end up with a reference to a
file hanging around indefinitely even after it had been deleted, for
example.
I've heard of someone updating read-only block snapshots by stopping
mountd, flushing the export cache, unmounting the old snapshot, then
mounting the new one and restarting mountd. A bit of a hack, but I
guess it works, as long as no clients hold locks or NFSv4 opens on the
filesystem.
An open cache may break that by holding references to the filesystem
they want to unmount. But perhaps we should give such users a proper
interface that tells nfsd to temporarily drop state it holds on a
filesystem, and tell them to use that instead.
> Please let me know if you would like me to write up a small text about how
> this patch works.
Any explanation always welcome.
> > Could you provide details sufficient to reproduce this test if
> > necessary? (At least: what was the test code, how many clients were
> > used, what was the client and server hardware, and what filesystem was
> > the server exporting?)
>
> Sure - I will send the test code in a day (don't have access to the system
> right
> now, sorry. But this is a script that runs a C program that forks and then
> reads
> a file till it is killed and it prints the amount of data read and the
> amount of
> time it ran).
>
> The other details are:
> #Clients: 1
> Hardware Configuration (both systems):
> Two Dual-Core AMD Opteron (4 cpus) at 3GH.
> 1GB memory
> 10gbps private network
> Filesystem: ext3 (one filesystem)
OK, thanks! And what sort of disk on the server?
--b.
next prev parent reply other threads:[~2009-02-05 20:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 10:42 [RFC PATCH 0/1] nfsd: Improve NFS server performance Krishna Kumar
[not found] ` <20081230104245.9409.30030.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-12-30 10:42 ` [RFC PATCH 1/1]: nfsd: By changing RA caching to file handle caching Krishna Kumar
2009-02-04 23:19 ` [RFC PATCH 0/1] nfsd: Improve NFS server performance J. Bruce Fields
2009-02-05 15:08 ` Krishna Kumar2
2009-02-05 20:24 ` J. Bruce Fields [this message]
2009-02-07 9:13 ` Krishna Kumar2
2009-02-09 19:06 ` J. Bruce Fields
2009-02-09 20:56 ` Chuck Lever
2009-02-09 21:04 ` J. Bruce Fields
[not found] ` <OFFC9EFD50.9BF4778E-ON65257583.0054B0F0-65257583.0056621F@in.ibm.com>
2009-03-24 18:00 ` J. Bruce Fields
2009-03-24 18:57 ` Krishna Kumar2
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=20090205202401.GH9200@fieldses.org \
--to=bfields@fieldses.org \
--cc=krkumar2@in.ibm.com \
--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