From: Ingo Molnar <mingo@elte.hu>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
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 17:10:21 +0200 [thread overview]
Message-ID: <20050331151021.GA5457@elte.hu> (raw)
In-Reply-To: <20050331145825.GA5107@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> > The good news, though, is that because requests on the "commit" list
> > do not remain locked for long without being removed from the list, you
> > should rarely have to skip them. IOW restarting from the head of the
> > list is pretty much the same as starting from where you left off.
>
> as we've learned it through painful experience on the ext3 side,
> restarting scans where 'skipping' has to be done is unhealthy.
>
> would it be safe to collect locked entries into a separate, local
> list, so that the restart would only see newly added entries? Then
> once the moving of all entries has been done, all the locked entries
> could be added back to the commit_list via one list_add. (can anything
> happen to those locked entries that would break this method?)
i.e. like the patch below (compiles and is lightly tested). It's a
pretty straightforward technique when dealing with latencies, and lets
us sleep for sure. We dont have to know whether massive amounts of
locked entries ever queue up or not.
(thanks go to Arjan for noticing that it has to be list_splice() not
list_add() :-| )
Ingo
--- linux/fs/nfs/pagelist.c.orig3
+++ linux/fs/nfs/pagelist.c
@@ -311,10 +311,12 @@ out:
* You must be holding the inode's req_lock when calling this function
*/
int
-nfs_scan_list(struct list_head *head, struct list_head *dst,
- unsigned long idx_start, unsigned int npages)
+nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head,
+ struct list_head *dst, unsigned long idx_start,
+ unsigned int npages)
{
- struct list_head *pos, *tmp;
+ LIST_HEAD(locked);
+ struct list_head *pos;
struct nfs_page *req;
unsigned long idx_end;
int res;
@@ -325,21 +327,22 @@ nfs_scan_list(struct list_head *head, st
else
idx_end = idx_start + npages - 1;
- list_for_each_safe(pos, tmp, head) {
+ while (!list_empty(head)) {
+ pos = head->next;
req = nfs_list_entry(pos);
- if (req->wb_index < idx_start)
- continue;
- if (req->wb_index > idx_end)
- break;
-
- if (!nfs_set_page_writeback_locked(req))
- continue;
- nfs_list_remove_request(req);
- nfs_list_add_request(req, dst);
- res++;
+ if (!nfs_set_page_writeback_locked(req)) {
+ list_del(pos);
+ list_add(&req->wb_list, &locked);
+ } else {
+ nfs_list_remove_request(req);
+ nfs_list_add_request(req, dst);
+ res++;
+ }
+ cond_resched_lock(&nfsi->req_lock);
}
+ list_splice(&locked, head);
return res;
}
--- linux/fs/nfs/write.c.orig3
+++ linux/fs/nfs/write.c
@@ -569,7 +569,7 @@ nfs_scan_commit(struct inode *inode, str
int res = 0;
if (nfsi->ncommit != 0) {
- res = nfs_scan_list(&nfsi->commit, dst, idx_start, npages);
+ res = nfs_scan_list(nfsi, &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");
--- linux/include/linux/nfs_page.h.orig3
+++ linux/include/linux/nfs_page.h
@@ -63,8 +63,8 @@ extern void nfs_release_request(struct n
extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
unsigned long idx_start, unsigned int npages);
-extern int nfs_scan_list(struct list_head *, struct list_head *,
- unsigned long, unsigned int);
+extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *,
+ struct list_head *, unsigned long, unsigned int);
extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
unsigned int);
extern int nfs_wait_on_request(struct nfs_page *);
next prev parent reply other threads:[~2005-03-31 15:13 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-29 23:04 NFS client latencies 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
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 [this message]
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=20050331151021.GA5457@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rlrevell@joe-job.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox