mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
	rlrevell@joe-job.com, linux-kernel@vger.kernel.org
Subject: Re: NFS client latencies
Date: Thu, 31 Mar 2005 06:58:24 -0500	[thread overview]
Message-ID: <1112270304.10975.41.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20050331073017.GA16577@elte.hu>

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

to den 31.03.2005 Klokka 09:30 (+0200) skreiv Ingo Molnar:


> > And presumably that list-based code rarely hits the worst-case, else
> > it would have been changed by now.
> 
> that was my other point in a previous mail: most write benchmarks do 
> continuous append writes, and CPU overhead easily gets lost in
> network 
> latency.

Well. Most _good_ write benchmarks go through a variety of scenarios.

The problem with the radix-tree is that in most cases you are swapping a
linear scan through only the dirty pages (most of which you want to try
to add to the list anyway) for a linear scan through the entire list of
pages.
Damn! I've forgotten an extra _obvious_ optimization that might help
here... See the attached patch.

> Also, considering that a good portion of the NFS client's code is still 
> running under the BKL one would assume if the BKL hurts performance it 
> would have been changed by now? ;-)

Funny you should mention that... Chuck happens to have spent the last
fortnight working on removing our BKL-addiction. ;-)

Cheers,
  Trond

-- 
Trond Myklebust <trond.myklebust@fys.uio.no>

[-- Attachment #2: Type: text/plain, Size: 1722 bytes --]

 fs/nfs/write.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

Index: linux-2.6.12-rc1/fs/nfs/write.c
===================================================================
--- linux-2.6.12-rc1.orig/fs/nfs/write.c
+++ linux-2.6.12-rc1/fs/nfs/write.c
@@ -539,12 +539,15 @@ static int
 nfs_scan_dirty(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
-	int	res;
-	res = nfs_scan_lock_dirty(nfsi, dst, idx_start, npages);
-	nfsi->ndirty -= res;
-	sub_page_state(nr_dirty,res);
-	if ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty))
-		printk(KERN_ERR "NFS: desynchronized value of nfs_i.ndirty.\n");
+	int res = 0;
+
+	if (nfsi->ndirty != 0) {
+		res = nfs_scan_lock_dirty(nfsi, dst, idx_start, npages);
+		nfsi->ndirty -= res;
+		sub_page_state(nr_dirty,res);
+		if ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty))
+			printk(KERN_ERR "NFS: desynchronized value of nfs_i.ndirty.\n");
+	}
 	return res;
 }
 
@@ -563,11 +566,14 @@ static int
 nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
-	int	res;
-	res = nfs_scan_list(&nfsi->commit, dst, idx_start, npages);
-	nfsi->ncommit -= res;
-	if ((nfsi->ncommit == 0) != list_empty(&nfsi->commit))
-		printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
+	int res;
+
+	if (nfsi->ncommit != 0) {
+		res = nfs_scan_list(&nfsi->commit, dst, idx_start, npages);
+		nfsi->ncommit -= res;
+		if ((nfsi->ncommit == 0) != list_empty(&nfsi->commit))
+			printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
+	}
 	return res;
 }
 #endif

  reply	other threads:[~2005-03-31 11:58 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-29 23:04 Lee Revell
2005-03-29 23:18 ` Trond Myklebust
2005-03-29 23:32   ` Lee Revell
2005-03-29 23:34     ` Trond Myklebust
2005-03-29 23:37       ` Lee Revell
2005-03-30  8:02       ` Ingo Molnar
2005-03-30 14:11         ` Trond Myklebust
2005-03-30 14:20           ` Ingo Molnar
2005-03-30 19:53             ` Andrew Morton
2005-03-30 14:26   ` Lee Revell
2005-03-30 14:50     ` Trond Myklebust
2005-03-30 19:50       ` Lee Revell
2005-03-30 19:56       ` Andrew Morton
2005-03-30 21:14         ` Trond Myklebust
2005-03-31  2:26           ` Lee Revell
2005-03-31  2:39             ` Andrew Morton
2005-03-31  2:47               ` Lee Revell
2005-03-31  3:48                 ` Trond Myklebust
2005-03-31  6:59                   ` Ingo Molnar
2005-03-31  7:15                     ` Ingo Molnar
2005-03-31  7:18                     ` Andrew Morton
2005-03-31  7:30                       ` Ingo Molnar
2005-03-31 11:58                         ` Trond Myklebust [this message]
2005-03-31 12:34                           ` Trond Myklebust
2005-03-31 13:58                             ` Ingo Molnar
2005-03-31 14:32                               ` Trond Myklebust
2005-03-31 14:39                                 ` Ingo Molnar
2005-03-31 14:50                                   ` Ingo Molnar
2005-04-01  2:28                                     ` Lee Revell
2005-04-01  4:30                                       ` Ingo Molnar
2005-04-01 16:16                                         ` Orion Poplawski
2005-04-01 16:33                                           ` Trond Myklebust
2005-04-01 21:18                                         ` Lee Revell
2005-03-31 14:54                                   ` Ingo Molnar
2005-03-31 15:00                                     ` Trond Myklebust
2005-03-31 14:54                                   ` Trond Myklebust
2005-03-31 14:58                                     ` Ingo Molnar
2005-03-31 15:06                                       ` Trond Myklebust
2005-03-31 15:10                                         ` Ingo Molnar
2005-03-31 16:00                                           ` Trond Myklebust
2005-03-31 15:10                                       ` Ingo Molnar
2005-03-31  7:03                 ` Ingo Molnar
2005-03-31  7:39             ` Ingo Molnar
2005-03-31  7:48               ` Ingo Molnar
2005-03-31  7:58                 ` Ingo Molnar

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=1112270304.10975.41.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rlrevell@joe-job.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

all inboxes | Powered by JetHome®